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_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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 class InkDropButtonListener; | 12 class InkDropButtonListener; |
13 class ShelfView; | 13 class ShelfView; |
14 | 14 |
15 // Button used for the AppList icon on the shelf. | 15 // Button used for the AppList icon on the shelf. |
16 class AppListButton : public views::ImageButton { | 16 class AppListButton : public views::ImageButton { |
17 public: | 17 public: |
18 explicit AppListButton(InkDropButtonListener* listener, | 18 explicit AppListButton(InkDropButtonListener* listener, |
19 ShelfView* shelf_view); | 19 ShelfView* shelf_view); |
20 ~AppListButton() override; | 20 ~AppListButton() override; |
21 | 21 |
| 22 void OnAppListShown(); |
| 23 void OnAppListDismissed(); |
| 24 |
22 bool draw_background_as_active() { return draw_background_as_active_; } | 25 bool draw_background_as_active() { return draw_background_as_active_; } |
23 | 26 |
24 protected: | 27 protected: |
25 // views::ImageButton overrides: | 28 // views::ImageButton overrides: |
26 bool OnMousePressed(const ui::MouseEvent& event) override; | 29 bool OnMousePressed(const ui::MouseEvent& event) override; |
27 void OnMouseReleased(const ui::MouseEvent& event) override; | 30 void OnMouseReleased(const ui::MouseEvent& event) override; |
28 void OnMouseCaptureLost() override; | 31 void OnMouseCaptureLost() override; |
29 bool OnMouseDragged(const ui::MouseEvent& event) override; | 32 bool OnMouseDragged(const ui::MouseEvent& event) override; |
30 void OnPaint(gfx::Canvas* canvas) override; | 33 void OnPaint(gfx::Canvas* canvas) override; |
31 void GetAccessibleState(ui::AXViewState* state) override; | 34 void GetAccessibleState(ui::AXViewState* state) override; |
| 35 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
32 void NotifyClick(const ui::Event& event) override; | 36 void NotifyClick(const ui::Event& event) override; |
| 37 bool ShouldEnterPushedState(const ui::Event& event) override; |
| 38 bool ShouldShowInkDropHighlight() const override; |
33 | 39 |
34 // ui::EventHandler overrides: | 40 // ui::EventHandler overrides: |
35 void OnGestureEvent(ui::GestureEvent* event) override; | 41 void OnGestureEvent(ui::GestureEvent* event) override; |
36 | 42 |
37 private: | 43 private: |
38 // Toggles the active state for painting the background and schedules a paint. | 44 // Toggles the active state for painting the background and schedules a paint. |
39 void SetDrawBackgroundAsActive(bool draw_background_as_active); | 45 void SetDrawBackgroundAsActive(bool draw_background_as_active); |
40 | 46 |
41 // Helper functions to paint the background and foreground of the AppList | 47 // Helper functions to paint the background and foreground of the AppList |
42 // button in Chrome OS MD. | 48 // button in Chrome OS MD. |
(...skipping 11 matching lines...) Expand all Loading... |
54 | 60 |
55 InkDropButtonListener* listener_; | 61 InkDropButtonListener* listener_; |
56 ShelfView* shelf_view_; | 62 ShelfView* shelf_view_; |
57 | 63 |
58 DISALLOW_COPY_AND_ASSIGN(AppListButton); | 64 DISALLOW_COPY_AND_ASSIGN(AppListButton); |
59 }; | 65 }; |
60 | 66 |
61 } // namespace ash | 67 } // namespace ash |
62 | 68 |
63 #endif // ASH_SHELF_APP_LIST_BUTTON_H_ | 69 #endif // ASH_SHELF_APP_LIST_BUTTON_H_ |
OLD | NEW |