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_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_H_ |
6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "ash/ash_export.h" | 12 #include "ash/ash_export.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "ui/gfx/vector_icon_types.h" | 15 #include "ui/gfx/vector_icon_types.h" |
16 | 16 |
| 17 namespace gfx { |
| 18 struct VectorIcon; |
| 19 } |
| 20 |
17 namespace views { | 21 namespace views { |
18 class View; | 22 class View; |
19 } | 23 } |
20 | 24 |
21 namespace ash { | 25 namespace ash { |
22 | 26 |
23 class WmWindow; | 27 class WmWindow; |
24 | 28 |
25 enum class PaletteGroup; | 29 enum class PaletteGroup; |
26 enum class PaletteToolId; | 30 enum class PaletteToolId; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 virtual void OnDisable(); | 81 virtual void OnDisable(); |
78 | 82 |
79 // Create a view that will be used in the palette, or nullptr if this tool | 83 // Create a view that will be used in the palette, or nullptr if this tool |
80 // should not be displayed. The view is owned by the caller. OnViewDestroyed | 84 // should not be displayed. The view is owned by the caller. OnViewDestroyed |
81 // is called when the view has been deallocated by its owner. | 85 // is called when the view has been deallocated by its owner. |
82 virtual views::View* CreateView() = 0; | 86 virtual views::View* CreateView() = 0; |
83 virtual void OnViewDestroyed() = 0; | 87 virtual void OnViewDestroyed() = 0; |
84 | 88 |
85 // Returns an icon to use in the tray if this tool is active. Only one tool | 89 // Returns an icon to use in the tray if this tool is active. Only one tool |
86 // (per-group) should ever have an active icon at any given time. | 90 // (per-group) should ever have an active icon at any given time. |
87 virtual gfx::VectorIconId GetActiveTrayIcon(); | 91 virtual const gfx::VectorIcon& GetActiveTrayIcon() const; |
88 | 92 |
89 protected: | 93 protected: |
90 // Enables/disables the tool. | 94 // Enables/disables the tool. |
91 bool enabled() const { return enabled_; } | 95 bool enabled() const { return enabled_; } |
92 | 96 |
93 Delegate* delegate() { return delegate_; } | 97 Delegate* delegate() { return delegate_; } |
94 | 98 |
95 private: | 99 private: |
96 bool enabled_ = false; | 100 bool enabled_ = false; |
97 | 101 |
98 // Unowned pointer to the delegate. The delegate should outlive this instance. | 102 // Unowned pointer to the delegate. The delegate should outlive this instance. |
99 Delegate* delegate_; | 103 Delegate* delegate_; |
100 | 104 |
101 DISALLOW_COPY_AND_ASSIGN(PaletteTool); | 105 DISALLOW_COPY_AND_ASSIGN(PaletteTool); |
102 }; | 106 }; |
103 | 107 |
104 } // namespace ash | 108 } // namespace ash |
105 | 109 |
106 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_H_ | 110 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_PALETTE_TOOL_H_ |
OLD | NEW |