OLD | NEW |
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 InkDropButtonListener; | 13 class InkDropButtonListener; |
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 OverflowButton(InkDropButtonListener* listener, WmShelf* wm_shelf); | 19 OverflowButton(InkDropButtonListener* listener, WmShelf* wm_shelf); |
20 ~OverflowButton() override; | 20 ~OverflowButton() override; |
21 | 21 |
22 void OnShelfAlignmentChanged(); | 22 void OnShelfAlignmentChanged(); |
23 | 23 |
| 24 // Sets alpha value of the background and schedules a paint. |
| 25 void SetBackgroundAlpha(int alpha); |
| 26 |
24 private: | 27 private: |
25 // views::View: | 28 // views::View: |
26 void OnPaint(gfx::Canvas* canvas) override; | 29 void OnPaint(gfx::Canvas* canvas) override; |
27 | 30 |
28 // views::CustomButton: | 31 // views::CustomButton: |
29 void NotifyClick(const ui::Event& event) override; | 32 void NotifyClick(const ui::Event& event) override; |
30 | 33 |
31 // Helper functions to paint the background and foreground of the button | 34 // Helper functions to paint the background and foreground of the button |
32 // at |bounds|. | 35 // at |bounds|. |
33 void PaintBackground(gfx::Canvas* canvas, const gfx::Rect& bounds); | 36 void PaintBackground(gfx::Canvas* canvas, const gfx::Rect& bounds); |
(...skipping 17 matching lines...) Expand all Loading... |
51 gfx::ImageSkia bottom_image_md_; | 54 gfx::ImageSkia bottom_image_md_; |
52 | 55 |
53 // Cached rotations of |bottom_image_| used for left and right shelf | 56 // Cached rotations of |bottom_image_| used for left and right shelf |
54 // alignments. | 57 // alignments. |
55 gfx::ImageSkia left_image_; | 58 gfx::ImageSkia left_image_; |
56 gfx::ImageSkia right_image_; | 59 gfx::ImageSkia right_image_; |
57 | 60 |
58 InkDropButtonListener* listener_; | 61 InkDropButtonListener* listener_; |
59 WmShelf* wm_shelf_; | 62 WmShelf* wm_shelf_; |
60 | 63 |
| 64 // Alpha value used to paint the background. |
| 65 int background_alpha_; |
| 66 |
61 DISALLOW_COPY_AND_ASSIGN(OverflowButton); | 67 DISALLOW_COPY_AND_ASSIGN(OverflowButton); |
62 }; | 68 }; |
63 | 69 |
64 } // namespace ash | 70 } // namespace ash |
65 | 71 |
66 #endif // ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_ | 72 #endif // ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_ |
OLD | NEW |