refactor: make StatusIconType an enum class (#36500)
Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
79d2fc9c23
commit
909ee0ed6b
2 changed files with 8 additions and 7 deletions
|
@ -30,7 +30,8 @@ gfx::ImageSkia GetBestImageRep(const gfx::ImageSkia& image) {
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TrayIconGtk::TrayIconGtk()
|
TrayIconGtk::TrayIconGtk()
|
||||||
: status_icon_(new StatusIconLinuxDbus), status_icon_type_(kTypeDbus) {
|
: status_icon_(new StatusIconLinuxDbus),
|
||||||
|
status_icon_type_(StatusIconType::kDbus) {
|
||||||
status_icon_->SetDelegate(this);
|
status_icon_->SetDelegate(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,11 +69,11 @@ ui::MenuModel* TrayIconGtk::GetMenuModel() const {
|
||||||
|
|
||||||
void TrayIconGtk::OnImplInitializationFailed() {
|
void TrayIconGtk::OnImplInitializationFailed() {
|
||||||
switch (status_icon_type_) {
|
switch (status_icon_type_) {
|
||||||
case kTypeDbus:
|
case StatusIconType::kDbus:
|
||||||
status_icon_ = nullptr;
|
status_icon_ = nullptr;
|
||||||
status_icon_type_ = kTypeNone;
|
status_icon_type_ = StatusIconType::kNone;
|
||||||
return;
|
return;
|
||||||
case kTypeNone:
|
case StatusIconType::kNone:
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,9 +36,9 @@ class TrayIconGtk : public TrayIcon, public ui::StatusIconLinux::Delegate {
|
||||||
void OnImplInitializationFailed() override;
|
void OnImplInitializationFailed() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum StatusIconType {
|
enum class StatusIconType {
|
||||||
kTypeDbus,
|
kDbus,
|
||||||
kTypeNone,
|
kNone,
|
||||||
};
|
};
|
||||||
|
|
||||||
scoped_refptr<StatusIconLinuxDbus> status_icon_;
|
scoped_refptr<StatusIconLinuxDbus> status_icon_;
|
||||||
|
|
Loading…
Reference in a new issue