OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ |
6 #define CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ | 6 #define CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 }; | 98 }; |
99 | 99 |
100 explicit TabRendererGtk(ThemeProvider* theme_provider); | 100 explicit TabRendererGtk(ThemeProvider* theme_provider); |
101 virtual ~TabRendererGtk(); | 101 virtual ~TabRendererGtk(); |
102 | 102 |
103 // TabContents. If only the loading state was updated, the loading_only flag | 103 // TabContents. If only the loading state was updated, the loading_only flag |
104 // should be specified. If other things change, set this flag to false to | 104 // should be specified. If other things change, set this flag to false to |
105 // update everything. | 105 // update everything. |
106 virtual void UpdateData(TabContents* contents, | 106 virtual void UpdateData(TabContents* contents, |
107 bool phantom, | 107 bool phantom, |
| 108 bool app, |
108 bool loading_only); | 109 bool loading_only); |
109 | 110 |
110 // Sets the blocked state of the tab. | 111 // Sets the blocked state of the tab. |
111 void SetBlocked(bool pinned); | 112 void SetBlocked(bool pinned); |
112 bool is_blocked() const; | 113 bool is_blocked() const; |
113 | 114 |
114 // Sets the mini-state of the tab. | 115 // Sets the mini-state of the tab. |
115 void set_mini(bool mini) { data_.mini = mini; } | 116 void set_mini(bool mini) { data_.mini = mini; } |
116 bool mini() const { return data_.mini; } | 117 bool mini() const { return data_.mini; } |
117 | 118 |
118 // Sets the phantom state of the tab. | 119 // Sets the phantom state of the tab. |
119 void set_phantom(bool phantom) { data_.phantom = phantom; } | 120 void set_phantom(bool phantom) { data_.phantom = phantom; } |
120 bool phantom() const { return data_.phantom; } | 121 bool phantom() const { return data_.phantom; } |
121 | 122 |
| 123 // Sets the app state of the tab. |
| 124 void set_app(bool app) { data_.app = app; } |
| 125 bool app() const { return data_.app; } |
| 126 |
122 // Are we in the process of animating a mini tab state change on this tab? | 127 // Are we in the process of animating a mini tab state change on this tab? |
123 void set_animating_mini_change(bool value) { | 128 void set_animating_mini_change(bool value) { |
124 data_.animating_mini_change = value; | 129 data_.animating_mini_change = value; |
125 } | 130 } |
126 | 131 |
127 // Updates the display to reflect the contents of this TabRenderer's model. | 132 // Updates the display to reflect the contents of this TabRenderer's model. |
128 void UpdateFromModel(); | 133 void UpdateFromModel(); |
129 | 134 |
130 // Returns true if the Tab is selected, false otherwise. | 135 // Returns true if the Tab is selected, false otherwise. |
131 virtual bool IsSelected() const; | 136 virtual bool IsSelected() const; |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 struct TabData { | 255 struct TabData { |
251 TabData() | 256 TabData() |
252 : is_default_favicon(false), | 257 : is_default_favicon(false), |
253 loading(false), | 258 loading(false), |
254 crashed(false), | 259 crashed(false), |
255 off_the_record(false), | 260 off_the_record(false), |
256 show_icon(true), | 261 show_icon(true), |
257 mini(false), | 262 mini(false), |
258 blocked(false), | 263 blocked(false), |
259 animating_mini_change(false), | 264 animating_mini_change(false), |
260 phantom(false) { | 265 phantom(false), |
| 266 app(false) { |
261 } | 267 } |
262 | 268 |
263 SkBitmap favicon; | 269 SkBitmap favicon; |
264 bool is_default_favicon; | 270 bool is_default_favicon; |
265 string16 title; | 271 string16 title; |
266 bool loading; | 272 bool loading; |
267 bool crashed; | 273 bool crashed; |
268 bool off_the_record; | 274 bool off_the_record; |
269 bool show_icon; | 275 bool show_icon; |
270 bool mini; | 276 bool mini; |
271 bool blocked; | 277 bool blocked; |
272 bool animating_mini_change; | 278 bool animating_mini_change; |
273 bool phantom; | 279 bool phantom; |
| 280 bool app; |
274 }; | 281 }; |
275 | 282 |
276 // TODO(jhawkins): Move into TabResources class. | 283 // TODO(jhawkins): Move into TabResources class. |
277 struct TabImage { | 284 struct TabImage { |
278 SkBitmap* image_l; | 285 SkBitmap* image_l; |
279 SkBitmap* image_c; | 286 SkBitmap* image_c; |
280 SkBitmap* image_r; | 287 SkBitmap* image_r; |
281 int l_width; | 288 int l_width; |
282 int r_width; | 289 int r_width; |
| 290 int y_offset; |
283 }; | 291 }; |
284 | 292 |
285 // Overridden from AnimationDelegate: | 293 // Overridden from AnimationDelegate: |
286 virtual void AnimationProgressed(const Animation* animation); | 294 virtual void AnimationProgressed(const Animation* animation); |
287 virtual void AnimationCanceled(const Animation* animation); | 295 virtual void AnimationCanceled(const Animation* animation); |
288 virtual void AnimationEnded(const Animation* animation); | 296 virtual void AnimationEnded(const Animation* animation); |
289 | 297 |
290 // Starts/Stops the crash animation. | 298 // Starts/Stops the crash animation. |
291 void StartCrashAnimation(); | 299 void StartCrashAnimation(); |
292 void StopCrashAnimation(); | 300 void StopCrashAnimation(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 static bool initialized_; | 377 static bool initialized_; |
370 | 378 |
371 // The bounds of various sections of the display. | 379 // The bounds of various sections of the display. |
372 gfx::Rect favicon_bounds_; | 380 gfx::Rect favicon_bounds_; |
373 gfx::Rect title_bounds_; | 381 gfx::Rect title_bounds_; |
374 gfx::Rect close_button_bounds_; | 382 gfx::Rect close_button_bounds_; |
375 | 383 |
376 TabData data_; | 384 TabData data_; |
377 | 385 |
378 static TabImage tab_active_; | 386 static TabImage tab_active_; |
| 387 static TabImage tab_active_nano_; |
379 static TabImage tab_inactive_; | 388 static TabImage tab_inactive_; |
| 389 static TabImage tab_inactive_nano_; |
380 static TabImage tab_alpha_; | 390 static TabImage tab_alpha_; |
| 391 static TabImage tab_alpha_nano_; |
381 | 392 |
382 static gfx::Font* title_font_; | 393 static gfx::Font* title_font_; |
383 static int title_font_height_; | 394 static int title_font_height_; |
384 | 395 |
385 static int close_button_width_; | 396 static int close_button_width_; |
386 static int close_button_height_; | 397 static int close_button_height_; |
387 | 398 |
388 static SkColor selected_title_color_; | 399 static SkColor selected_title_color_; |
389 static SkColor unselected_title_color_; | 400 static SkColor unselected_title_color_; |
390 | 401 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // The current color of the close button. | 451 // The current color of the close button. |
441 SkColor close_button_color_; | 452 SkColor close_button_color_; |
442 | 453 |
443 // Used to listen for theme change notifications. | 454 // Used to listen for theme change notifications. |
444 NotificationRegistrar registrar_; | 455 NotificationRegistrar registrar_; |
445 | 456 |
446 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); | 457 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); |
447 }; | 458 }; |
448 | 459 |
449 #endif // CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ | 460 #endif // CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ |
OLD | NEW |