| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SHELF_APP_LIST_BUTTON_H_ | 5 #ifndef ASH_SHELF_APP_LIST_BUTTON_H_ |
| 6 #define ASH_SHELF_APP_LIST_BUTTON_H_ | 6 #define ASH_SHELF_APP_LIST_BUTTON_H_ |
| 7 | 7 |
| 8 #include "ui/views/controls/button/image_button.h" | 8 #include "ui/views/controls/button/image_button.h" |
| 9 | 9 |
| 10 namespace ash { | 10 namespace ash { |
| 11 | |
| 12 class ShelfWidget; | |
| 13 | |
| 14 namespace internal { | 11 namespace internal { |
| 15 | 12 |
| 16 class ShelfButtonHost; | 13 class ShelfButtonHost; |
| 17 | 14 |
| 18 // Button used for the AppList icon on the shelf. | 15 // Button used for the AppList icon on the shelf. |
| 19 class AppListButton : public views::ImageButton { | 16 class AppListButton : public views::ImageButton { |
| 20 public: | 17 public: |
| 21 // Bounds size (inset) required for the app icon image (in pixels). | 18 AppListButton(views::ButtonListener* listener, ShelfButtonHost* host); |
| 22 static const int kImageBoundsSize; | |
| 23 | |
| 24 AppListButton(views::ButtonListener* listener, | |
| 25 ShelfButtonHost* host, | |
| 26 ShelfWidget* shelf_widget); | |
| 27 virtual ~AppListButton(); | 19 virtual ~AppListButton(); |
| 28 | 20 |
| 21 void StartLoadingAnimation(); |
| 22 void StopLoadingAnimation(); |
| 23 |
| 29 protected: | 24 protected: |
| 30 // views::ImageButton overrides: | 25 // views::ImageButton: |
| 31 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 26 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 32 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 27 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 33 virtual void OnMouseCaptureLost() OVERRIDE; | 28 virtual void OnMouseCaptureLost() OVERRIDE; |
| 34 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 29 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; |
| 35 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; | 30 virtual void OnMouseMoved(const ui::MouseEvent& event) OVERRIDE; |
| 36 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 31 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
| 37 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 32 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
| 38 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | |
| 39 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 33 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
| 40 | 34 |
| 41 // ui::EventHandler overrides: | |
| 42 virtual void OnGestureEvent(ui::GestureEvent* event) OVERRIDE; | |
| 43 | |
| 44 private: | 35 private: |
| 45 ShelfButtonHost* host_; | 36 ShelfButtonHost* host_; |
| 46 // Reference to the shelf widget containing this button, owned by the | |
| 47 // root window controller. | |
| 48 ShelfWidget* shelf_widget_; | |
| 49 | 37 |
| 50 DISALLOW_COPY_AND_ASSIGN(AppListButton); | 38 DISALLOW_COPY_AND_ASSIGN(AppListButton); |
| 51 }; | 39 }; |
| 52 | 40 |
| 53 } // namespace internal | 41 } // namespace internal |
| 54 } // namespace ash | 42 } // namespace ash |
| 55 | 43 |
| 56 #endif // ASH_SHELF_APP_LIST_BUTTON_H_ | 44 #endif // ASH_SHELF_APP_LIST_BUTTON_H_ |
| OLD | NEW |