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_FRAME_HEADER_PAINTER_H_ | 5 #ifndef ASH_FRAME_HEADER_PAINTER_H_ |
6 #define ASH_FRAME_HEADER_PAINTER_H_ | 6 #define ASH_FRAME_HEADER_PAINTER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" // OVERRIDE | 10 #include "base/compiler_specific.h" // OVERRIDE |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 HeaderPainter(); | 49 HeaderPainter(); |
50 virtual ~HeaderPainter(); | 50 virtual ~HeaderPainter(); |
51 | 51 |
52 // None of the parameters are owned. | 52 // None of the parameters are owned. |
53 void Init(Style style, | 53 void Init(Style style, |
54 views::Widget* frame, | 54 views::Widget* frame, |
55 views::View* header_view, | 55 views::View* header_view, |
56 views::View* window_icon, | 56 views::View* window_icon, |
57 FrameCaptionButtonContainerView* caption_button_container); | 57 FrameCaptionButtonContainerView* caption_button_container); |
58 | 58 |
| 59 // Sets the avatar icon to the header. Passing NULL removes the avatar icon. |
| 60 void UpdateAvatarIcon(views::View* avatar_icon); |
| 61 |
59 // Returns the bounds of the client view for a window with |header_height| | 62 // Returns the bounds of the client view for a window with |header_height| |
60 // and |window_bounds|. The return value and |window_bounds| are in the | 63 // and |window_bounds|. The return value and |window_bounds| are in the |
61 // views::NonClientView's coordinates. | 64 // views::NonClientView's coordinates. |
62 static gfx::Rect GetBoundsForClientView(int header_height, | 65 static gfx::Rect GetBoundsForClientView(int header_height, |
63 const gfx::Rect& window_bounds); | 66 const gfx::Rect& window_bounds); |
64 | 67 |
65 // Returns the bounds of the window given |header_height| and |client_bounds|. | 68 // Returns the bounds of the window given |header_height| and |client_bounds|. |
66 // The return value and |client_bounds| are in the views::NonClientView's | 69 // The return value and |client_bounds| are in the views::NonClientView's |
67 // coordinates. | 70 // coordinates. |
68 static gfx::Rect GetWindowBoundsForClientBounds( | 71 static gfx::Rect GetWindowBoundsForClientBounds( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 void UpdateCaptionButtonImages(); | 139 void UpdateCaptionButtonImages(); |
137 | 140 |
138 // Returns the header bounds in the coordinates of |header_view_|. The header | 141 // Returns the header bounds in the coordinates of |header_view_|. The header |
139 // is assumed to be positioned at the top left corner of |header_view_| and to | 142 // is assumed to be positioned at the top left corner of |header_view_| and to |
140 // have the same width as |header_view_|. | 143 // have the same width as |header_view_|. |
141 gfx::Rect GetHeaderLocalBounds() const; | 144 gfx::Rect GetHeaderLocalBounds() const; |
142 | 145 |
143 // Returns the offset between window left edge and title string. | 146 // Returns the offset between window left edge and title string. |
144 int GetTitleOffsetX() const; | 147 int GetTitleOffsetX() const; |
145 | 148 |
| 149 // Returns the offset between window left edge and the window icon. |
| 150 int GetWindowIconOffsetX() const; |
| 151 |
146 // Returns the vertical center of the caption button container in window | 152 // Returns the vertical center of the caption button container in window |
147 // coordinates. | 153 // coordinates. |
148 int GetCaptionButtonContainerCenterY() const; | 154 int GetCaptionButtonContainerCenterY() const; |
149 | 155 |
150 // Returns the radius of the header's top corners. | 156 // Returns the radius of the header's top corners. |
151 int GetHeaderCornerRadius() const; | 157 int GetHeaderCornerRadius() const; |
152 | 158 |
153 // Get the bounds for the title. The provided |title_font_list| is used to | 159 // Get the bounds for the title. The provided |title_font_list| is used to |
154 // determine the correct dimensions. | 160 // determine the correct dimensions. |
155 gfx::Rect GetTitleBounds(const gfx::FontList& title_font_list); | 161 gfx::Rect GetTitleBounds(const gfx::FontList& title_font_list); |
156 | 162 |
157 Style style_; | 163 Style style_; |
158 | 164 |
159 // Not owned | 165 // Not owned |
160 views::Widget* frame_; | 166 views::Widget* frame_; |
161 views::View* header_view_; | 167 views::View* header_view_; |
162 views::View* window_icon_; // May be NULL. | 168 views::View* window_icon_; // May be NULL. |
| 169 views::View* avatar_icon_; // May be NULL. |
163 FrameCaptionButtonContainerView* caption_button_container_; | 170 FrameCaptionButtonContainerView* caption_button_container_; |
164 | 171 |
165 // The height of the header. | 172 // The height of the header. |
166 int header_height_; | 173 int header_height_; |
167 | 174 |
168 // Image ids and opacity last used for painting header. | 175 // Image ids and opacity last used for painting header. |
169 int previous_theme_frame_id_; | 176 int previous_theme_frame_id_; |
170 int previous_theme_frame_overlay_id_; | 177 int previous_theme_frame_overlay_id_; |
171 | 178 |
172 // Image ids and opacity we are crossfading from. | 179 // Image ids and opacity we are crossfading from. |
173 int crossfade_theme_frame_id_; | 180 int crossfade_theme_frame_id_; |
174 int crossfade_theme_frame_overlay_id_; | 181 int crossfade_theme_frame_overlay_id_; |
175 | 182 |
176 scoped_ptr<gfx::SlideAnimation> crossfade_animation_; | 183 scoped_ptr<gfx::SlideAnimation> crossfade_animation_; |
177 | 184 |
178 DISALLOW_COPY_AND_ASSIGN(HeaderPainter); | 185 DISALLOW_COPY_AND_ASSIGN(HeaderPainter); |
179 }; | 186 }; |
180 | 187 |
181 } // namespace ash | 188 } // namespace ash |
182 | 189 |
183 #endif // ASH_FRAME_HEADER_PAINTER_H_ | 190 #endif // ASH_FRAME_HEADER_PAINTER_H_ |
OLD | NEW |