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