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 "third_party/skia/include/core/SkColor.h" |
10 #include "ui/views/controls/button/image_button.h" | 11 #include "ui/views/controls/button/image_button.h" |
11 | 12 |
12 namespace ash { | 13 namespace ash { |
13 class InkDropButtonListener; | 14 class InkDropButtonListener; |
14 class ShelfView; | 15 class ShelfView; |
15 class WmShelf; | 16 class WmShelf; |
16 | 17 |
17 // Button used for the AppList icon on the shelf. | 18 // Button used for the AppList icon on the shelf. |
18 class ASH_EXPORT AppListButton : public views::ImageButton { | 19 class ASH_EXPORT AppListButton : public views::ImageButton { |
19 public: | 20 public: |
20 AppListButton(InkDropButtonListener* listener, | 21 AppListButton(InkDropButtonListener* listener, |
21 ShelfView* shelf_view, | 22 ShelfView* shelf_view, |
22 WmShelf* wm_shelf); | 23 WmShelf* wm_shelf); |
23 ~AppListButton() override; | 24 ~AppListButton() override; |
24 | 25 |
25 void OnAppListShown(); | 26 void OnAppListShown(); |
26 void OnAppListDismissed(); | 27 void OnAppListDismissed(); |
27 | 28 |
28 bool is_showing_app_list() const { return is_showing_app_list_; } | 29 bool is_showing_app_list() const { return is_showing_app_list_; } |
29 | 30 |
30 bool draw_background_as_active() const { return draw_background_as_active_; } | 31 bool draw_background_as_active() const { return draw_background_as_active_; } |
31 | 32 |
32 // Sets alpha value of the background and schedules a paint. | 33 // Updates background and schedules a paint. |
33 void SetBackgroundAlpha(int alpha); | 34 void UpdateShelfItemBackground(SkColor color); |
34 | 35 |
35 protected: | 36 protected: |
36 // views::ImageButton overrides: | 37 // views::ImageButton overrides: |
37 bool OnMousePressed(const ui::MouseEvent& event) override; | 38 bool OnMousePressed(const ui::MouseEvent& event) override; |
38 void OnMouseReleased(const ui::MouseEvent& event) override; | 39 void OnMouseReleased(const ui::MouseEvent& event) override; |
39 void OnMouseCaptureLost() override; | 40 void OnMouseCaptureLost() override; |
40 bool OnMouseDragged(const ui::MouseEvent& event) override; | 41 bool OnMouseDragged(const ui::MouseEvent& event) override; |
41 void OnPaint(gfx::Canvas* canvas) override; | 42 void OnPaint(gfx::Canvas* canvas) override; |
42 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; | 43 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
43 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 44 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
(...skipping 22 matching lines...) Expand all Loading... |
66 gfx::Point GetCenterPoint() const; | 67 gfx::Point GetCenterPoint() const; |
67 | 68 |
68 // True if the app list is currently showing for this display. | 69 // True if the app list is currently showing for this display. |
69 // This is useful because other IsApplistVisible functions aren't per-display. | 70 // This is useful because other IsApplistVisible functions aren't per-display. |
70 bool is_showing_app_list_; | 71 bool is_showing_app_list_; |
71 | 72 |
72 // True if the background should render as active, regardless of the state of | 73 // True if the background should render as active, regardless of the state of |
73 // the application list. | 74 // the application list. |
74 bool draw_background_as_active_; | 75 bool draw_background_as_active_; |
75 | 76 |
76 // Alpha value used to paint the background. | 77 // Color used to paint the background. |
77 int background_alpha_; | 78 SkColor background_color_; |
78 | 79 |
79 InkDropButtonListener* listener_; | 80 InkDropButtonListener* listener_; |
80 ShelfView* shelf_view_; | 81 ShelfView* shelf_view_; |
81 WmShelf* wm_shelf_; | 82 WmShelf* wm_shelf_; |
82 | 83 |
83 DISALLOW_COPY_AND_ASSIGN(AppListButton); | 84 DISALLOW_COPY_AND_ASSIGN(AppListButton); |
84 }; | 85 }; |
85 | 86 |
86 } // namespace ash | 87 } // namespace ash |
87 | 88 |
88 #endif // ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ | 89 #endif // ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ |
OLD | NEW |