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