OLD | NEW |
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 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_MANAGER_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_MANAGER_H_ |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_MANAGER_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // deactivated state. This class takes ownership over |tool|. | 60 // deactivated state. This class takes ownership over |tool|. |
61 void AddTool(std::unique_ptr<PaletteTool> tool); | 61 void AddTool(std::unique_ptr<PaletteTool> tool); |
62 | 62 |
63 // Activates tool_id and deactivates any other active tool in the same | 63 // Activates tool_id and deactivates any other active tool in the same |
64 // group as tool_id. | 64 // group as tool_id. |
65 void ActivateTool(PaletteToolId tool_id); | 65 void ActivateTool(PaletteToolId tool_id); |
66 | 66 |
67 // Deactivates the given tool. | 67 // Deactivates the given tool. |
68 void DeactivateTool(PaletteToolId tool_id); | 68 void DeactivateTool(PaletteToolId tool_id); |
69 | 69 |
70 // Optional methods that are not likely to be needed, but will be | 70 // Returns true if the given tool is active. |
71 // implemented if necessary. | |
72 bool IsToolActive(PaletteToolId tool_id); | 71 bool IsToolActive(PaletteToolId tool_id); |
| 72 |
| 73 // Returns the active tool for the given group. |
73 PaletteToolId GetActiveTool(PaletteGroup group); | 74 PaletteToolId GetActiveTool(PaletteGroup group); |
74 | 75 |
75 // Fetch the active tray icon for the given tool. Returns | 76 // Fetch the active tray icon for the given tool. Returns |
76 // gfx::VectorIconId::VECTOR_ICON_NONE if not available. | 77 // gfx::VectorIconId::VECTOR_ICON_NONE if not available. |
77 gfx::VectorIconId GetActiveTrayIcon(PaletteToolId tool_id); | 78 gfx::VectorIconId GetActiveTrayIcon(PaletteToolId tool_id); |
78 | 79 |
79 // Create views for all of the registered tools. | 80 // Create views for all of the registered tools. |
80 std::vector<PaletteToolView> CreateViews(); | 81 std::vector<PaletteToolView> CreateViews(); |
81 | 82 |
82 // Called when the views returned by CreateViews have been destroyed. This | 83 // Called when the views returned by CreateViews have been destroyed. This |
(...skipping 17 matching lines...) Expand all Loading... |
100 | 101 |
101 // Owned list of all tools. | 102 // Owned list of all tools. |
102 std::vector<std::unique_ptr<PaletteTool>> tools_; | 103 std::vector<std::unique_ptr<PaletteTool>> tools_; |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(PaletteToolManager); | 105 DISALLOW_COPY_AND_ASSIGN(PaletteToolManager); |
105 }; | 106 }; |
106 | 107 |
107 } // namespace ash | 108 } // namespace ash |
108 | 109 |
109 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_MANAGER_H_ | 110 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_MANAGER_H_ |
OLD | NEW |