OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ |
6 #define ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/string16.h" | |
10 | |
11 namespace views { | 9 namespace views { |
12 class MouseEvent; | 10 class MouseEvent; |
13 class View; | 11 class View; |
14 } | 12 } |
15 | 13 |
16 namespace ash { | 14 namespace ash { |
17 namespace internal { | 15 namespace internal { |
18 | 16 |
19 // The launcher buttons communicate back to the host by way of this interface. | 17 // The launcher buttons communicate back to the host by way of this interface. |
20 // This interface is used to enable reordering the items on the launcher. | 18 // This interface is used to enable reordering the items on the launcher. |
21 class LauncherButtonHost { | 19 class LauncherButtonHost { |
22 public: | 20 public: |
23 // Invoked when the mose is pressed on a view. | 21 // Invoked when the mose is pressed on a view. |
24 virtual void MousePressedOnButton(views::View* view, | 22 virtual void MousePressedOnButton(views::View* view, |
25 const views::MouseEvent& event) = 0; | 23 const views::MouseEvent& event) = 0; |
26 | 24 |
27 // Invoked when the mouse is dragged over a view. | 25 // Invoked when the mouse is dragged over a view. |
28 virtual void MouseDraggedOnButton(views::View* view, | 26 virtual void MouseDraggedOnButton(views::View* view, |
29 const views::MouseEvent& event) = 0; | 27 const views::MouseEvent& event) = 0; |
30 | 28 |
31 // Invoked either if the mouse is released or mouse capture canceled. | 29 // Invoked either if the mouse is released or mouse capture canceled. |
32 virtual void MouseReleasedOnButton(views::View* view, | 30 virtual void MouseReleasedOnButton(views::View* view, |
33 bool canceled) = 0; | 31 bool canceled) = 0; |
34 | 32 |
35 // Invoked when the mouse exits the item. | 33 // Invoked when the mouse exits the item. |
36 virtual void MouseExitedButton(views::View* view) = 0; | 34 virtual void MouseExitedButton(views::View* view) = 0; |
37 | 35 |
38 // Invoked to get the accessible name of the item. | |
39 virtual string16 GetAccessibleName(views::View* view) = 0; | |
40 | |
41 protected: | 36 protected: |
42 virtual ~LauncherButtonHost() {} | 37 virtual ~LauncherButtonHost() {} |
43 }; | 38 }; |
44 | 39 |
45 } // namespace internal | 40 } // namespace internal |
46 } // namespace ash | 41 } // namespace ash |
47 | 42 |
48 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ | 43 #endif // ASH_LAUNCHER_LAUNCHER_BUTTON_HOST_H_ |
OLD | NEW |