| 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_SHELF_BUTTON_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_BUTTON_H_ |
| 6 #define ASH_COMMON_SHELF_SHELF_BUTTON_H_ | 6 #define ASH_COMMON_SHELF_SHELF_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/gfx/shadow_value.h" | 10 #include "ui/gfx/shadow_value.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // views::CustomButton overrides: | 87 // views::CustomButton overrides: |
| 88 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 88 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| 89 bool ShouldEnterPushedState(const ui::Event& event) override; | 89 bool ShouldEnterPushedState(const ui::Event& event) override; |
| 90 std::unique_ptr<views::InkDrop> CreateInkDrop() override; | 90 std::unique_ptr<views::InkDrop> CreateInkDrop() override; |
| 91 void NotifyClick(const ui::Event& event) override; | 91 void NotifyClick(const ui::Event& event) override; |
| 92 | 92 |
| 93 // Sets the icon image with a shadow. | 93 // Sets the icon image with a shadow. |
| 94 void SetShadowedImage(const gfx::ImageSkia& bitmap); | 94 void SetShadowedImage(const gfx::ImageSkia& bitmap); |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 class BarView; | 97 class AppStatusIndicatorView; |
| 98 | 98 |
| 99 // Updates the parts of the button to reflect the current |state_| and | 99 // Updates the parts of the button to reflect the current |state_| and |
| 100 // alignment. This may add or remove views, layout and paint. | 100 // alignment. This may add or remove views, layout and paint. |
| 101 void UpdateState(); | 101 void UpdateState(); |
| 102 | 102 |
| 103 // Updates the status bar (bitmap, orientation, visibility). | |
| 104 void UpdateBar(); | |
| 105 | |
| 106 InkDropButtonListener* listener_; | 103 InkDropButtonListener* listener_; |
| 107 | 104 |
| 108 // The shelf view hosting this button. | 105 // The shelf view hosting this button. |
| 109 ShelfView* shelf_view_; | 106 ShelfView* shelf_view_; |
| 110 | 107 |
| 111 // The icon part of a button can be animated independently of the rest. | 108 // The icon part of a button can be animated independently of the rest. |
| 112 views::ImageView* icon_view_; | 109 views::ImageView* icon_view_; |
| 113 | 110 |
| 114 // Draws a bar underneath the image to represent the state of the application. | 111 // Draws an indicator underneath the image to represent the state of the |
| 115 BarView* bar_; | 112 // application. |
| 113 AppStatusIndicatorView* indicator_; |
| 116 | 114 |
| 117 // The current application state, a bitfield of State enum values. | 115 // The current application state, a bitfield of State enum values. |
| 118 int state_; | 116 int state_; |
| 119 | 117 |
| 120 gfx::ShadowValues icon_shadows_; | 118 gfx::ShadowValues icon_shadows_; |
| 121 | 119 |
| 122 // If non-null the destuctor sets this to true. This is set while the menu is | 120 // If non-null the destuctor sets this to true. This is set while the menu is |
| 123 // showing and used to detect if the menu was deleted while running. | 121 // showing and used to detect if the menu was deleted while running. |
| 124 bool* destroyed_flag_; | 122 bool* destroyed_flag_; |
| 125 | 123 |
| 126 DISALLOW_COPY_AND_ASSIGN(ShelfButton); | 124 DISALLOW_COPY_AND_ASSIGN(ShelfButton); |
| 127 }; | 125 }; |
| 128 | 126 |
| 129 } // namespace ash | 127 } // namespace ash |
| 130 | 128 |
| 131 #endif // ASH_COMMON_SHELF_SHELF_BUTTON_H_ | 129 #endif // ASH_COMMON_SHELF_SHELF_BUTTON_H_ |
| OLD | NEW |