| 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 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 OverflowButton(InkDropButtonListener* listener, WmShelf* wm_shelf); | 19 // |shelf_view| is the view containing this button. |
| 20 OverflowButton(ShelfView* shelf_view, WmShelf* wm_shelf); |
| 20 ~OverflowButton() override; | 21 ~OverflowButton() override; |
| 21 | 22 |
| 22 void OnShelfAlignmentChanged(); | 23 void OnShelfAlignmentChanged(); |
| 23 | 24 |
| 24 // Sets alpha value of the background and schedules a paint. | 25 // Sets alpha value of the background and schedules a paint. |
| 25 void SetBackgroundAlpha(int alpha); | 26 void SetBackgroundAlpha(int alpha); |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 // views::View: | 29 // views::View: |
| 29 void OnPaint(gfx::Canvas* canvas) override; | 30 void OnPaint(gfx::Canvas* canvas) override; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 51 // TODO(tdanderson): Remove the non-md code once the material design shelf is | 52 // TODO(tdanderson): Remove the non-md code once the material design shelf is |
| 52 // enabled by default. See crbug.com/614453. | 53 // enabled by default. See crbug.com/614453. |
| 53 const gfx::ImageSkia* bottom_image_; | 54 const gfx::ImageSkia* bottom_image_; |
| 54 gfx::ImageSkia bottom_image_md_; | 55 gfx::ImageSkia bottom_image_md_; |
| 55 | 56 |
| 56 // Cached rotations of |bottom_image_| used for left and right shelf | 57 // Cached rotations of |bottom_image_| used for left and right shelf |
| 57 // alignments. | 58 // alignments. |
| 58 gfx::ImageSkia left_image_; | 59 gfx::ImageSkia left_image_; |
| 59 gfx::ImageSkia right_image_; | 60 gfx::ImageSkia right_image_; |
| 60 | 61 |
| 61 InkDropButtonListener* listener_; | 62 ShelfView* shelf_view_; |
| 62 WmShelf* wm_shelf_; | 63 WmShelf* wm_shelf_; |
| 63 | 64 |
| 64 // Alpha value used to paint the background. | 65 // Alpha value used to paint the background. |
| 65 int background_alpha_; | 66 int background_alpha_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(OverflowButton); | 68 DISALLOW_COPY_AND_ASSIGN(OverflowButton); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace ash | 71 } // namespace ash |
| 71 | 72 |
| 72 #endif // ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_ | 73 #endif // ASH_COMMON_SHELF_OVERFLOW_BUTTON_H_ |
| OLD | NEW |