Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: ash/common/shelf/app_list_button.h

Issue 2679133003: [ash-md] Wired in the Shelf color to be derived from the Wallpaper. (Closed)
Patch Set: Addressed nits. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/common/shelf/app_list_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/common/shelf/app_list_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698