| OLD | NEW |
| 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 "ui/views/controls/button/image_button.h" | 10 #include "ui/views/controls/button/image_button.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 std::unique_ptr<views::InkDrop> CreateInkDrop() override; | 44 std::unique_ptr<views::InkDrop> CreateInkDrop() override; |
| 45 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; | 45 std::unique_ptr<views::InkDropMask> CreateInkDropMask() const override; |
| 46 | 46 |
| 47 // ui::EventHandler overrides: | 47 // ui::EventHandler overrides: |
| 48 void OnGestureEvent(ui::GestureEvent* event) override; | 48 void OnGestureEvent(ui::GestureEvent* event) override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 // Toggles the active state for painting the background and schedules a paint. | 51 // Toggles the active state for painting the background and schedules a paint. |
| 52 void SetDrawBackgroundAsActive(bool draw_background_as_active); | 52 void SetDrawBackgroundAsActive(bool draw_background_as_active); |
| 53 | 53 |
| 54 // Helper functions to paint the background and foreground of the AppList | 54 // Helper function to paint the background and foreground of the AppList |
| 55 // button in Chrome OS MD. | 55 // button in Chrome OS MD. |
| 56 void PaintBackgroundMD(gfx::Canvas* canvas); | 56 void PaintMd(gfx::Canvas* canvas); |
| 57 void PaintForegroundMD(gfx::Canvas* canvas, | |
| 58 const gfx::ImageSkia& foreground_image); | |
| 59 | 57 |
| 60 // Helper function to paint the AppList button in Chrome OS non-MD. | 58 // Helper function to paint the AppList button in Chrome OS non-MD. |
| 61 void PaintAppListButton(gfx::Canvas* canvas, | 59 void PaintAppListButton(gfx::Canvas* canvas, |
| 62 const gfx::ImageSkia& foreground_image); | 60 const gfx::ImageSkia& foreground_image); |
| 63 | 61 |
| 64 // Get the center point of the app list button used to draw its background and | 62 // Get the center point of the app list button used to draw its background and |
| 65 // ink drops. | 63 // ink drops. |
| 66 gfx::Point GetCenterPoint() const; | 64 gfx::Point GetCenterPoint() const; |
| 67 | 65 |
| 68 // True if the background should render as active, regardless of the state of | 66 // True if the background should render as active, regardless of the state of |
| 69 // the application list. | 67 // the application list. |
| 70 bool draw_background_as_active_; | 68 bool draw_background_as_active_; |
| 71 | 69 |
| 72 // Alpha value used to paint the background. | 70 // Alpha value used to paint the background. |
| 73 int background_alpha_; | 71 int background_alpha_; |
| 74 | 72 |
| 75 InkDropButtonListener* listener_; | 73 InkDropButtonListener* listener_; |
| 76 ShelfView* shelf_view_; | 74 ShelfView* shelf_view_; |
| 77 WmShelf* wm_shelf_; | 75 WmShelf* wm_shelf_; |
| 78 | 76 |
| 79 DISALLOW_COPY_AND_ASSIGN(AppListButton); | 77 DISALLOW_COPY_AND_ASSIGN(AppListButton); |
| 80 }; | 78 }; |
| 81 | 79 |
| 82 } // namespace ash | 80 } // namespace ash |
| 83 | 81 |
| 84 #endif // ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ | 82 #endif // ASH_COMMON_SHELF_APP_LIST_BUTTON_H_ |
| OLD | NEW |