Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6061)

Unified Diff: ash/common/system/chromeos/settings/tray_settings.cc

Issue 2330403002: Do not activate system tray bubble by default (Closed)
Patch Set: Do not activate system tray bubble by default Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/settings/tray_settings.cc
diff --git a/ash/common/system/chromeos/settings/tray_settings.cc b/ash/common/system/chromeos/settings/tray_settings.cc
index 1c495b3eee8011b620e76cf00a526e2a84fb9169..d7bcfdfed55d0eb31982a31cf3404953ade8d91b 100644
--- a/ash/common/system/chromeos/settings/tray_settings.cc
+++ b/ash/common/system/chromeos/settings/tray_settings.cc
@@ -34,8 +34,11 @@ namespace tray {
class SettingsDefaultView : public ActionableView,
public PowerStatus::Observer {
public:
- explicit SettingsDefaultView(LoginStatus status)
- : login_status_(status), label_(NULL), power_status_view_(NULL) {
+ SettingsDefaultView(SystemTrayItem* owner, LoginStatus status)
+ : ActionableView(owner),
+ login_status_(status),
+ label_(nullptr),
+ power_status_view_(nullptr) {
PowerStatus::Get()->AddObserver(this);
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
ash::kTrayPopupPaddingHorizontal, 0,
@@ -86,6 +89,7 @@ class SettingsDefaultView : public ActionableView,
}
WmShell::Get()->system_tray_delegate()->ShowSettings();
+ CloseSystemBubble();
return true;
}
@@ -139,29 +143,29 @@ TraySettings::TraySettings(SystemTray* system_tray)
TraySettings::~TraySettings() {}
views::View* TraySettings::CreateTrayView(LoginStatus status) {
- return NULL;
+ return nullptr;
}
views::View* TraySettings::CreateDefaultView(LoginStatus status) {
if ((status == LoginStatus::NOT_LOGGED_IN || status == LoginStatus::LOCKED) &&
!PowerStatus::Get()->IsBatteryPresent())
- return NULL;
+ return nullptr;
if (!WmShell::Get()->system_tray_delegate()->ShouldShowSettings())
- return NULL;
- CHECK(default_view_ == NULL);
- default_view_ = new tray::SettingsDefaultView(status);
+ return nullptr;
+ CHECK(default_view_ == nullptr);
+ default_view_ = new tray::SettingsDefaultView(this, status);
return default_view_;
}
views::View* TraySettings::CreateDetailedView(LoginStatus status) {
NOTIMPLEMENTED();
- return NULL;
+ return nullptr;
}
void TraySettings::DestroyTrayView() {}
void TraySettings::DestroyDefaultView() {
- default_view_ = NULL;
+ default_view_ = nullptr;
}
void TraySettings::DestroyDetailedView() {}
« no previous file with comments | « ash/common/system/chromeos/network/network_state_list_detailed_view.cc ('k') | ash/common/system/chromeos/tray_caps_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698