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

Side by Side 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: Update comment Created 4 years 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 unified diff | Download patch
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tray.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/system/chromeos/palette/palette_tray.h" 5 #include "ash/common/system/chromeos/palette/palette_tray.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/session/session_state_delegate.h" 8 #include "ash/common/session/session_state_delegate.h"
9 #include "ash/common/shelf/shelf_constants.h" 9 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/wm_shelf.h" 10 #include "ash/common/shelf/wm_shelf.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 HidePalette(); 429 HidePalette();
430 } 430 }
431 } 431 }
432 432
433 // Disable any active modes if the stylus has been inserted. 433 // Disable any active modes if the stylus has been inserted.
434 if (stylus_state == ui::StylusState::INSERTED) 434 if (stylus_state == ui::StylusState::INSERTED)
435 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE); 435 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE);
436 } 436 }
437 437
438 void PaletteTray::OnPaletteEnabledPrefChanged(bool enabled) { 438 void PaletteTray::OnPaletteEnabledPrefChanged(bool enabled) {
439 is_palette_enabled_ = enabled;
440
439 if (!enabled) { 441 if (!enabled) {
440 SetVisible(false); 442 SetVisible(false);
441 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE); 443 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE);
442 } else { 444 } else {
443 UpdateIconVisibility(); 445 UpdateIconVisibility();
444 } 446 }
445 } 447 }
446 448
447 void PaletteTray::UpdateIconVisibility() { 449 void PaletteTray::UpdateIconVisibility() {
448 SetVisible(IsInUserSession()); 450 SetVisible(is_palette_enabled_ && IsInUserSession());
449 } 451 }
450 452
451 } // namespace ash 453 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tray.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698