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

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

Issue 2679133003: [ash-md] Wired in the Shelf color to be derived from the Wallpaper. (Closed)
Patch Set: Ready for review. 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
OLDNEW
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_COMMON_SHELF_OVERFLOW_BUTTON_H_ 5 #ifndef ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_
6 #define ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_ 6 #define ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/gfx/image/image_skia.h" 9 #include "ui/gfx/image/image_skia.h"
10 #include "ui/views/controls/button/custom_button.h" 10 #include "ui/views/controls/button/custom_button.h"
11 11
12 namespace ash { 12 namespace ash {
13 class ShelfView; 13 class ShelfView;
14 class WmShelf; 14 class WmShelf;
15 15
16 // Shelf overflow chevron button. 16 // Shelf overflow chevron button.
17 class OverflowButton : public views::CustomButton { 17 class OverflowButton : public views::CustomButton {
18 public: 18 public:
19 // |shelf_view| is the view containing this button. 19 // |shelf_view| is the view containing this button.
20 OverflowButton(ShelfView* shelf_view, WmShelf* wm_shelf); 20 OverflowButton(ShelfView* shelf_view, WmShelf* wm_shelf);
21 ~OverflowButton() override; 21 ~OverflowButton() override;
22 22
23 void OnShelfAlignmentChanged(); 23 void OnShelfAlignmentChanged();
24 void OnOverflowBubbleShown(); 24 void OnOverflowBubbleShown();
25 void OnOverflowBubbleHidden(); 25 void OnOverflowBubbleHidden();
26 26
27 // Sets alpha value of the background and schedules a paint. 27 // Updates background and schedules a paint.
28 void SetBackgroundAlpha(int alpha); 28 void UpdateShelfItemBackground(SkColor color);
29 29
30 private: 30 private:
31 // views::CustomButton: 31 // views::CustomButton:
32 void OnPaint(gfx::Canvas* canvas) override; 32 void OnPaint(gfx::Canvas* canvas) override;
33 std::unique_ptr<views::InkDrop> CreateInkDrop() override; 33 std::unique_ptr<views::InkDrop> CreateInkDrop() override;
34 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; 34 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
35 bool ShouldEnterPushedState(const ui::Event& event) override; 35 bool ShouldEnterPushedState(const ui::Event& event) override;
36 void NotifyClick(const ui::Event& event) override; 36 void NotifyClick(const ui::Event& event) override;
37 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; 37 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override;
38 38
(...skipping 20 matching lines...) Expand all
59 gfx::ImageSkia bottom_image_md_; 59 gfx::ImageSkia bottom_image_md_;
60 60
61 // Cached rotations of |bottom_image_| used for left and right shelf 61 // Cached rotations of |bottom_image_| used for left and right shelf
62 // alignments. 62 // alignments.
63 gfx::ImageSkia left_image_; 63 gfx::ImageSkia left_image_;
64 gfx::ImageSkia right_image_; 64 gfx::ImageSkia right_image_;
65 65
66 ShelfView* shelf_view_; 66 ShelfView* shelf_view_;
67 WmShelf* wm_shelf_; 67 WmShelf* wm_shelf_;
68 68
69 // Alpha value used to paint the background. 69 // Color used to paint the background;
msw 2017/02/24 02:28:12 nit: period
bruthig 2017/02/25 17:51:18 D'oh
70 int background_alpha_; 70 SkColor background_color_;
71 71
72 DISALLOW_COPY_AND_ASSIGN(OverflowButton); 72 DISALLOW_COPY_AND_ASSIGN(OverflowButton);
73 }; 73 };
74 74
75 } // namespace ash 75 } // namespace ash
76 76
77 #endif // ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_ 77 #endif // ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698