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

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: Rebase 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
« no previous file with comments | « ash/common/system/chromeos/palette/palette_utils.cc ('k') | ash/common/test/test_palette_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 93b14213e3660aa96ebdfa4643e2820fb67badb5..cf5ae68e1a7ff2b35187053b56b02bf069553dae 100644
--- a/ash/common/system/status_area_widget.cc
+++ b/ash/common/system/status_area_widget.cc
@@ -22,6 +22,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
@@ -200,7 +201,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();
}
@@ -224,7 +226,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);
}
@@ -248,8 +251,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() {
« no previous file with comments | « ash/common/system/chromeos/palette/palette_utils.cc ('k') | ash/common/test/test_palette_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698