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

Unified Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2535773004: Make sure stylus tools are always hidden if disabled by the user. (Closed)
Patch Set: Created 4 years, 1 month 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/palette/palette_tray.cc
diff --git a/ash/common/system/chromeos/palette/palette_tray.cc b/ash/common/system/chromeos/palette/palette_tray.cc
index 5e5d9501c212871fe7ac1c1a1a04b20d29b952eb..2b006f9d0fb2ee6f75bb1ce2d2920d671842f563 100644
--- a/ash/common/system/chromeos/palette/palette_tray.cc
+++ b/ash/common/system/chromeos/palette/palette_tray.cc
@@ -436,6 +436,8 @@ void PaletteTray::OnStylusStateChanged(ui::StylusState stylus_state) {
}
void PaletteTray::OnPaletteEnabledPrefChanged(bool enabled) {
+ is_palette_enabled_ = enabled;
+
if (!enabled) {
SetVisible(false);
palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE);
@@ -445,7 +447,7 @@ void PaletteTray::OnPaletteEnabledPrefChanged(bool enabled) {
}
void PaletteTray::UpdateIconVisibility() {
- SetVisible(IsInUserSession());
+ SetVisible(is_palette_enabled_ && IsInUserSession());
}
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698