| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SHELF_APP_LIST_BUTTON_H_ | 5 #ifndef ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ |
| 6 #define ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ | 6 #define ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/views/controls/button/image_button.h" | 10 #include "ui/views/controls/button/image_button.h" |
| 11 | 11 |
| 12 namespace views { |
| 13 class InkDrop; |
| 14 } // namespace views |
| 15 |
| 12 namespace ash { | 16 namespace ash { |
| 13 class InkDropButtonListener; | 17 class InkDropButtonListener; |
| 14 class ShelfView; | 18 class ShelfView; |
| 15 class WmShelf; | 19 class WmShelf; |
| 16 | 20 |
| 17 // Button used for the AppList icon on the shelf. | 21 // Button used for the AppList icon on the shelf. |
| 18 class ASH_EXPORT AppListButton : public views::ImageButton { | 22 class ASH_EXPORT AppListButton : public views::ImageButton { |
| 19 public: | 23 public: |
| 20 AppListButton(InkDropButtonListener* listener, | 24 AppListButton(InkDropButtonListener* listener, |
| 21 ShelfView* shelf_view, | 25 ShelfView* shelf_view, |
| (...skipping 12 matching lines...) Expand all Loading... |
| 34 // views::ImageButton overrides: | 38 // views::ImageButton overrides: |
| 35 bool OnMousePressed(const ui::MouseEvent& event) override; | 39 bool OnMousePressed(const ui::MouseEvent& event) override; |
| 36 void OnMouseReleased(const ui::MouseEvent& event) override; | 40 void OnMouseReleased(const ui::MouseEvent& event) override; |
| 37 void OnMouseCaptureLost() override; | 41 void OnMouseCaptureLost() override; |
| 38 bool OnMouseDragged(const ui::MouseEvent& event) override; | 42 bool OnMouseDragged(const ui::MouseEvent& event) override; |
| 39 void OnPaint(gfx::Canvas* canvas) override; | 43 void OnPaint(gfx::Canvas* canvas) override; |
| 40 void GetAccessibleState(ui::AXViewState* state) override; | 44 void GetAccessibleState(ui::AXViewState* state) override; |
| 41 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 45 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| 42 void NotifyClick(const ui::Event& event) override; | 46 void NotifyClick(const ui::Event& event) override; |
| 43 bool ShouldEnterPushedState(const ui::Event& event) override; | 47 bool ShouldEnterPushedState(const ui::Event& event) override; |
| 44 bool ShouldShowInkDropHighlight() const override; | 48 std::unique_ptr<views::InkDrop> CreateInkDrop() override; |
| 45 | 49 |
| 46 // ui::EventHandler overrides: | 50 // ui::EventHandler overrides: |
| 47 void OnGestureEvent(ui::GestureEvent* event) override; | 51 void OnGestureEvent(ui::GestureEvent* event) override; |
| 48 | 52 |
| 49 private: | 53 private: |
| 50 // Toggles the active state for painting the background and schedules a paint. | 54 // Toggles the active state for painting the background and schedules a paint. |
| 51 void SetDrawBackgroundAsActive(bool draw_background_as_active); | 55 void SetDrawBackgroundAsActive(bool draw_background_as_active); |
| 52 | 56 |
| 53 // Helper functions to paint the background and foreground of the AppList | 57 // Helper functions to paint the background and foreground of the AppList |
| 54 // button in Chrome OS MD. | 58 // button in Chrome OS MD. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 70 InkDropButtonListener* listener_; | 74 InkDropButtonListener* listener_; |
| 71 ShelfView* shelf_view_; | 75 ShelfView* shelf_view_; |
| 72 WmShelf* wm_shelf_; | 76 WmShelf* wm_shelf_; |
| 73 | 77 |
| 74 DISALLOW_COPY_AND_ASSIGN(AppListButton); | 78 DISALLOW_COPY_AND_ASSIGN(AppListButton); |
| 75 }; | 79 }; |
| 76 | 80 |
| 77 } // namespace ash | 81 } // namespace ash |
| 78 | 82 |
| 79 #endif // ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ | 83 #endif // ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ |
| OLD | NEW |