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

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

Issue 2291913002: Allow the user to cancel the capture region action, and show its active status in the tray. (Closed)
Patch Set: 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.h" 5 #include "ash/common/system/chromeos/palette/palette_tool.h"
6 6
7 #include "ash/common/system/chromeos/palette/palette_tool_manager.h" 7 #include "ash/common/system/chromeos/palette/palette_tool_manager.h"
8 #include "ash/common/system/chromeos/palette/palette_utils.h" 8 #include "ash/common/system/chromeos/palette/palette_utils.h"
9 #include "ash/common/system/chromeos/palette/tools/capture_region_action.h" 9 #include "ash/common/system/chromeos/palette/tools/capture_region_mode.h"
10 #include "ash/common/system/chromeos/palette/tools/capture_screen_action.h" 10 #include "ash/common/system/chromeos/palette/tools/capture_screen_action.h"
11 #include "ash/common/system/chromeos/palette/tools/create_note_action.h" 11 #include "ash/common/system/chromeos/palette/tools/create_note_action.h"
12 #include "ash/common/system/chromeos/palette/tools/magnifier_mode.h" 12 #include "ash/common/system/chromeos/palette/tools/magnifier_mode.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "ui/gfx/vector_icons_public.h" 14 #include "ui/gfx/vector_icons_public.h"
15 15
16 namespace ash { 16 namespace ash {
17 17
18 // static 18 // static
19 void PaletteTool::RegisterToolInstances(PaletteToolManager* tool_manager) { 19 void PaletteTool::RegisterToolInstances(PaletteToolManager* tool_manager) {
20 tool_manager->AddTool(base::MakeUnique<CaptureRegionAction>(tool_manager)); 20 tool_manager->AddTool(base::MakeUnique<CaptureRegionMode>(tool_manager));
21 tool_manager->AddTool(base::MakeUnique<CaptureScreenAction>(tool_manager)); 21 tool_manager->AddTool(base::MakeUnique<CaptureScreenAction>(tool_manager));
22 tool_manager->AddTool(base::MakeUnique<CreateNoteAction>(tool_manager)); 22 tool_manager->AddTool(base::MakeUnique<CreateNoteAction>(tool_manager));
23 if (ArePaletteExperimentalFeaturesEnabled()) 23 if (ArePaletteExperimentalFeaturesEnabled())
24 tool_manager->AddTool(base::MakeUnique<MagnifierMode>(tool_manager)); 24 tool_manager->AddTool(base::MakeUnique<MagnifierMode>(tool_manager));
25 } 25 }
26 26
27 PaletteTool::PaletteTool(Delegate* delegate) : delegate_(delegate) {} 27 PaletteTool::PaletteTool(Delegate* delegate) : delegate_(delegate) {}
28 28
29 PaletteTool::~PaletteTool() {} 29 PaletteTool::~PaletteTool() {}
30 30
31 void PaletteTool::OnEnable() { 31 void PaletteTool::OnEnable() {
32 enabled_ = true; 32 enabled_ = true;
33 } 33 }
34 34
35 void PaletteTool::OnDisable() { 35 void PaletteTool::OnDisable() {
36 enabled_ = false; 36 enabled_ = false;
37 } 37 }
38 38
39 gfx::VectorIconId PaletteTool::GetActiveTrayIcon() { 39 gfx::VectorIconId PaletteTool::GetActiveTrayIcon() {
40 return gfx::VectorIconId::VECTOR_ICON_NONE; 40 return gfx::VectorIconId::VECTOR_ICON_NONE;
41 } 41 }
42 42
43 } // namespace ash 43 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698