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

Side by Side Diff: ash/common/system/chromeos/palette/palette_tray.cc

Issue 2532083008: Make sure stylus tools are always hidden if disabled by the user. (Closed)
Patch Set: 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 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 HidePalette(); 449 HidePalette();
450 } 450 }
451 } 451 }
452 452
453 // Disable any active modes if the stylus has been inserted. 453 // Disable any active modes if the stylus has been inserted.
454 if (stylus_state == ui::StylusState::INSERTED) 454 if (stylus_state == ui::StylusState::INSERTED)
455 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE); 455 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE);
456 } 456 }
457 457
458 void PaletteTray::OnPaletteEnabledPrefChanged(bool enabled) { 458 void PaletteTray::OnPaletteEnabledPrefChanged(bool enabled) {
459 is_palette_enabled_ = enabled;
460
459 if (!enabled) { 461 if (!enabled) {
460 SetVisible(false); 462 SetVisible(false);
461 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE); 463 palette_tool_manager_->DisableActiveTool(PaletteGroup::MODE);
462 } else { 464 } else {
463 UpdateIconVisibility(); 465 UpdateIconVisibility();
464 } 466 }
465 } 467 }
466 468
467 void PaletteTray::UpdateIconVisibility() { 469 void PaletteTray::UpdateIconVisibility() {
468 SetVisible(IsInUserSession()); 470 SetVisible(is_palette_enabled_ && IsInUserSession());
469 } 471 }
470 472
471 } // namespace ash 473 } // 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