| 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_COMMON_PALETTE_TOOL_H_ | 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ | 6 #define ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ |
| 7 | 7 |
| 8 #include "ash/common/system/chromeos/palette/palette_tool.h" | 8 #include "ash/common/system/chromeos/palette/palette_tool.h" |
| 9 #include "ash/common/system/tray/hover_highlight_view.h" | |
| 10 #include "ash/common/system/tray/view_click_listener.h" | 9 #include "ash/common/system/tray/view_click_listener.h" |
| 11 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 12 #include "ui/gfx/vector_icons_public.h" | 11 |
| 12 namespace gfx { |
| 13 struct VectorIcon; |
| 14 } |
| 13 | 15 |
| 14 namespace ash { | 16 namespace ash { |
| 15 | 17 |
| 18 class HoverHighlightView; |
| 19 |
| 16 // A PaletteTool implementation with a standard view support. | 20 // A PaletteTool implementation with a standard view support. |
| 17 class CommonPaletteTool : public PaletteTool, public ash::ViewClickListener { | 21 class CommonPaletteTool : public PaletteTool, public ash::ViewClickListener { |
| 18 protected: | 22 protected: |
| 19 explicit CommonPaletteTool(Delegate* delegate); | 23 explicit CommonPaletteTool(Delegate* delegate); |
| 20 ~CommonPaletteTool() override; | 24 ~CommonPaletteTool() override; |
| 21 | 25 |
| 22 // PaletteTool: | 26 // PaletteTool: |
| 23 views::View* CreateView() override; | 27 views::View* CreateView() override; |
| 24 void OnViewDestroyed() override; | 28 void OnViewDestroyed() override; |
| 25 void OnEnable() override; | 29 void OnEnable() override; |
| 26 void OnDisable() override; | 30 void OnDisable() override; |
| 27 | 31 |
| 28 // ViewClickListener: | 32 // ViewClickListener: |
| 29 void OnViewClicked(views::View* sender) override; | 33 void OnViewClicked(views::View* sender) override; |
| 30 | 34 |
| 31 // Returns the icon used in the palette tray on the left-most edge of the | 35 // Returns the icon used in the palette tray on the left-most edge of the |
| 32 // tool. | 36 // tool. |
| 33 virtual gfx::VectorIconId GetPaletteIconId() = 0; | 37 virtual const gfx::VectorIcon& GetPaletteIcon() const = 0; |
| 34 | 38 |
| 35 // Creates a default view implementation to be returned by CreateView. | 39 // Creates a default view implementation to be returned by CreateView. |
| 36 views::View* CreateDefaultView(const base::string16& name); | 40 views::View* CreateDefaultView(const base::string16& name); |
| 37 | 41 |
| 38 private: | 42 private: |
| 39 HoverHighlightView* highlight_view_ = nullptr; | 43 HoverHighlightView* highlight_view_ = nullptr; |
| 40 | 44 |
| 41 DISALLOW_COPY_AND_ASSIGN(CommonPaletteTool); | 45 DISALLOW_COPY_AND_ASSIGN(CommonPaletteTool); |
| 42 }; | 46 }; |
| 43 | 47 |
| 44 } // namespace ash | 48 } // namespace ash |
| 45 | 49 |
| 46 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ | 50 #endif // ASH_COMMON_SYSTEM_CHROMEOS_PALETTE_COMMON_PALETTE_TOOL_H_ |
| OLD | NEW |