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_SHELF_SHELF_BUTTON_H_ | 5 #ifndef ASH_SHELF_SHELF_BUTTON_H_ |
6 #define ASH_SHELF_SHELF_BUTTON_H_ | 6 #define ASH_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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 private: | 83 private: |
84 class BarView; | 84 class BarView; |
85 | 85 |
86 // Updates the parts of the button to reflect the current |state_| and | 86 // Updates the parts of the button to reflect the current |state_| and |
87 // alignment. This may add or remove views, layout and paint. | 87 // alignment. This may add or remove views, layout and paint. |
88 void UpdateState(); | 88 void UpdateState(); |
89 | 89 |
90 // Updates the status bar (bitmap, orientation, visibility). | 90 // Updates the status bar (bitmap, orientation, visibility). |
91 void UpdateBar(); | 91 void UpdateBar(); |
92 | 92 |
| 93 // Paints an activity indicator on |canvas| whose |size| is specified in DIP. |
| 94 void PaintIndicatorOnCanvas(gfx::Canvas* canvas, const gfx::Size& size); |
| 95 |
93 // The shelf view hosting this button. | 96 // The shelf view hosting this button. |
94 ShelfView* shelf_view_; | 97 ShelfView* shelf_view_; |
95 | 98 |
96 // The icon part of a button can be animated independently of the rest. | 99 // The icon part of a button can be animated independently of the rest. |
97 views::ImageView* icon_view_; | 100 views::ImageView* icon_view_; |
98 | 101 |
99 // Draws a bar underneath the image to represent the state of the application. | 102 // Draws a bar underneath the image to represent the state of the application. |
100 BarView* bar_; | 103 BarView* bar_; |
101 | 104 |
102 // The current application state, a bitfield of State enum values. | 105 // The current application state, a bitfield of State enum values. |
103 int state_; | 106 int state_; |
104 | 107 |
105 gfx::ShadowValues icon_shadows_; | 108 gfx::ShadowValues icon_shadows_; |
106 | 109 |
107 // If non-null the destuctor sets this to true. This is set while the menu is | 110 // If non-null the destuctor sets this to true. This is set while the menu is |
108 // showing and used to detect if the menu was deleted while running. | 111 // showing and used to detect if the menu was deleted while running. |
109 bool* destroyed_flag_; | 112 bool* destroyed_flag_; |
110 | 113 |
111 DISALLOW_COPY_AND_ASSIGN(ShelfButton); | 114 DISALLOW_COPY_AND_ASSIGN(ShelfButton); |
112 }; | 115 }; |
113 | 116 |
114 } // namespace ash | 117 } // namespace ash |
115 | 118 |
116 #endif // ASH_SHELF_SHELF_BUTTON_H_ | 119 #endif // ASH_SHELF_SHELF_BUTTON_H_ |
OLD | NEW |