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

Unified Diff: ash/common/system/status_area_widget.cc

Issue 2258553004: Add pref to enable/disable palette tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Initial upload Created 4 years, 4 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/status_area_widget.cc
diff --git a/ash/common/system/status_area_widget.cc b/ash/common/system/status_area_widget.cc
index 34d04a6f3e4bd30cab675388a4a5d9e3ace9e234..c42e3ebb96017659fe0ea0043602e45bbadf7245 100644
--- a/ash/common/system/status_area_widget.cc
+++ b/ash/common/system/status_area_widget.cc
@@ -20,6 +20,7 @@
#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
#include "ash/common/system/chromeos/palette/palette_tray.h"
+#include "ash/common/system/chromeos/palette/palette_utils.h"
#include "ash/common/system/chromeos/session/logout_button_tray.h"
#include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.h"
#endif
@@ -133,7 +134,8 @@ void StatusAreaWidget::SchedulePaint() {
virtual_keyboard_tray_->SchedulePaint();
logout_button_tray_->SchedulePaint();
ime_menu_tray_->SchedulePaint();
- palette_tray_->SchedulePaint();
+ if (palette_tray_)
+ palette_tray_->SchedulePaint();
#endif
overview_button_tray_->SchedulePaint();
}
@@ -151,7 +153,8 @@ void StatusAreaWidget::UpdateShelfItemBackground(int alpha) {
virtual_keyboard_tray_->UpdateShelfItemBackground(alpha);
logout_button_tray_->UpdateShelfItemBackground(alpha);
ime_menu_tray_->UpdateShelfItemBackground(alpha);
- palette_tray_->UpdateShelfItemBackground(alpha);
+ if (palette_tray_)
+ palette_tray_->UpdateShelfItemBackground(alpha);
#endif
overview_button_tray_->UpdateShelfItemBackground(alpha);
}
@@ -175,8 +178,10 @@ void StatusAreaWidget::AddLogoutButtonTray() {
}
void StatusAreaWidget::AddPaletteTray() {
- palette_tray_ = new PaletteTray(wm_shelf_);
- status_area_widget_delegate_->AddTray(palette_tray_);
+ if (IsPaletteFeatureEnabled()) {
+ palette_tray_ = new PaletteTray(wm_shelf_);
+ status_area_widget_delegate_->AddTray(palette_tray_);
+ }
}
void StatusAreaWidget::AddVirtualKeyboardTray() {

Powered by Google App Engine
This is Rietveld 408576698