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_APP_LIST_BUTTON_H_ | 5 #ifndef ASH_LAUNCHER_APP_LIST_BUTTON_H_ |
6 #define ASH_LAUNCHER_APP_LIST_BUTTON_H_ | 6 #define ASH_LAUNCHER_APP_LIST_BUTTON_H_ |
7 | 7 |
| 8 #include "ash/wm/app_list_controller_observer.h" |
8 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
9 | 10 |
10 namespace ash { | 11 namespace ash { |
11 namespace internal { | 12 namespace internal { |
12 | 13 |
13 class LauncherButtonHost; | 14 class LauncherButtonHost; |
14 | 15 |
15 // Button used for the AppList icon on the launcher. | 16 // Button used for the AppList icon on the launcher. |
16 class AppListButton : public views::ImageButton { | 17 class AppListButton : public views::ToggleImageButton, |
| 18 public AppListControllerObserver { |
17 public: | 19 public: |
18 AppListButton(views::ButtonListener* listener, | 20 AppListButton(views::ButtonListener* listener, |
19 LauncherButtonHost* host); | 21 LauncherButtonHost* host); |
20 virtual ~AppListButton(); | 22 virtual ~AppListButton(); |
21 | 23 |
22 void StartLoadingAnimation(); | 24 void StartLoadingAnimation(); |
23 void StopLoadingAnimation(); | 25 void StopLoadingAnimation(); |
24 | 26 |
25 protected: | 27 protected: |
26 // View overrides: | 28 // View overrides: |
27 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 29 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
28 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 30 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
29 virtual void OnMouseCaptureLost() OVERRIDE; | 31 virtual void OnMouseCaptureLost() OVERRIDE; |
30 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 32 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
31 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 33 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; |
32 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 34 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
33 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 35 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
34 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 36 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
35 | 37 |
36 private: | 38 private: |
| 39 // AppListControllerObserver overrides: |
| 40 virtual void OnAppLauncherVisibilityChanged( |
| 41 bool visible, |
| 42 const aura::RootWindow* root_window) OVERRIDE; |
| 43 |
37 LauncherButtonHost* host_; | 44 LauncherButtonHost* host_; |
38 | 45 |
39 DISALLOW_COPY_AND_ASSIGN(AppListButton); | 46 DISALLOW_COPY_AND_ASSIGN(AppListButton); |
40 }; | 47 }; |
41 | 48 |
42 } // namespace internal | 49 } // namespace internal |
43 } // namespace ash | 50 } // namespace ash |
44 | 51 |
45 #endif // ASH_LAUNCHER_APP_LIST_BUTTON_H_ | 52 #endif // ASH_LAUNCHER_APP_LIST_BUTTON_H_ |
OLD | NEW |