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

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

Issue 2346833003: cros: Hide stylus tools on various sign-in screens, disable active mode when inserting stylus. (Closed)
Patch Set: Initial upload Created 4 years, 3 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 unified diff | Download patch
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_tool_manager.h" 5 #include "ash/common/system/chromeos/palette/palette_tool_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/common/system/chromeos/palette/palette_tool.h" 9 #include "ash/common/system/chromeos/palette/palette_tool.h"
10 #include "ash/resources/vector_icons/vector_icons.h" 10 #include "ash/resources/vector_icons/vector_icons.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 99 }
100 100
101 return views; 101 return views;
102 } 102 }
103 103
104 void PaletteToolManager::NotifyViewsDestroyed() { 104 void PaletteToolManager::NotifyViewsDestroyed() {
105 for (std::unique_ptr<PaletteTool>& tool : tools_) 105 for (std::unique_ptr<PaletteTool>& tool : tools_)
106 tool->OnViewDestroyed(); 106 tool->OnViewDestroyed();
107 } 107 }
108 108
109 void PaletteToolManager::DisableActiveTool(PaletteGroup group) {
110 PaletteToolId tool_id = GetActiveTool(group);
111 if (tool_id != PaletteToolId::NONE)
112 DeactivateTool(tool_id);
113 }
114
109 void PaletteToolManager::EnableTool(PaletteToolId tool_id) { 115 void PaletteToolManager::EnableTool(PaletteToolId tool_id) {
110 ActivateTool(tool_id); 116 ActivateTool(tool_id);
111 } 117 }
112 118
113 void PaletteToolManager::DisableTool(PaletteToolId tool_id) { 119 void PaletteToolManager::DisableTool(PaletteToolId tool_id) {
114 DeactivateTool(tool_id); 120 DeactivateTool(tool_id);
115 } 121 }
116 122
117 void PaletteToolManager::HidePalette() { 123 void PaletteToolManager::HidePalette() {
118 delegate_->HidePalette(); 124 delegate_->HidePalette();
(...skipping 15 matching lines...) Expand all
134 PaletteTool* PaletteToolManager::FindToolById(PaletteToolId tool_id) const { 140 PaletteTool* PaletteToolManager::FindToolById(PaletteToolId tool_id) const {
135 for (const std::unique_ptr<PaletteTool>& tool : tools_) { 141 for (const std::unique_ptr<PaletteTool>& tool : tools_) {
136 if (tool->GetToolId() == tool_id) 142 if (tool->GetToolId() == tool_id)
137 return tool.get(); 143 return tool.get();
138 } 144 }
139 145
140 return nullptr; 146 return nullptr;
141 } 147 }
142 148
143 } // namespace ash 149 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/chromeos/palette/palette_tool_manager.h ('k') | ash/common/system/chromeos/palette/palette_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698