| 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 | 9 |
| 10 #include "app/animation.h" | 10 #include "app/animation.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 // Model data. We store this here so that we don't need to ask the underlying | 154 // Model data. We store this here so that we don't need to ask the underlying |
| 155 // model, which is tricky since instances of this object can outlive the | 155 // model, which is tricky since instances of this object can outlive the |
| 156 // corresponding objects in the underlying model. | 156 // corresponding objects in the underlying model. |
| 157 struct TabData { | 157 struct TabData { |
| 158 SkBitmap favicon; | 158 SkBitmap favicon; |
| 159 std::wstring title; | 159 std::wstring title; |
| 160 bool loading; | 160 bool loading; |
| 161 bool crashed; | 161 bool crashed; |
| 162 bool off_the_record; | 162 bool off_the_record; |
| 163 bool show_icon; | 163 bool show_icon; |
| 164 bool show_download_icon; | |
| 165 }; | 164 }; |
| 166 | 165 |
| 167 // TODO(jhawkins): Move into TabResources class. | 166 // TODO(jhawkins): Move into TabResources class. |
| 168 struct TabImage { | 167 struct TabImage { |
| 169 SkBitmap* image_l; | 168 SkBitmap* image_l; |
| 170 SkBitmap* image_c; | 169 SkBitmap* image_c; |
| 171 SkBitmap* image_r; | 170 SkBitmap* image_r; |
| 172 int l_width; | 171 int l_width; |
| 173 int r_width; | 172 int r_width; |
| 174 }; | 173 }; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // expose-event handler that redraws the tab. | 230 // expose-event handler that redraws the tab. |
| 232 static gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e, | 231 static gboolean OnExpose(GtkWidget* widget, GdkEventExpose* e, |
| 233 TabRendererGtk* tab); | 232 TabRendererGtk* tab); |
| 234 | 233 |
| 235 // TODO(jhawkins): Move to TabResources. | 234 // TODO(jhawkins): Move to TabResources. |
| 236 static void InitResources(); | 235 static void InitResources(); |
| 237 static bool initialized_; | 236 static bool initialized_; |
| 238 | 237 |
| 239 // The bounds of various sections of the display. | 238 // The bounds of various sections of the display. |
| 240 gfx::Rect favicon_bounds_; | 239 gfx::Rect favicon_bounds_; |
| 241 gfx::Rect download_icon_bounds_; | |
| 242 gfx::Rect title_bounds_; | 240 gfx::Rect title_bounds_; |
| 243 gfx::Rect close_button_bounds_; | 241 gfx::Rect close_button_bounds_; |
| 244 | 242 |
| 245 TabData data_; | 243 TabData data_; |
| 246 | 244 |
| 247 static TabImage tab_active_; | 245 static TabImage tab_active_; |
| 248 static TabImage tab_inactive_; | 246 static TabImage tab_inactive_; |
| 249 static TabImage tab_alpha; | 247 static TabImage tab_alpha; |
| 250 static TabImage tab_hover_; | 248 static TabImage tab_hover_; |
| 251 | 249 |
| 252 static gfx::Font* title_font_; | 250 static gfx::Font* title_font_; |
| 253 static int title_font_height_; | 251 static int title_font_height_; |
| 254 | 252 |
| 255 static SkBitmap* download_icon_; | |
| 256 static int download_icon_width_; | |
| 257 static int download_icon_height_; | |
| 258 | |
| 259 static int close_button_width_; | 253 static int close_button_width_; |
| 260 static int close_button_height_; | 254 static int close_button_height_; |
| 261 | 255 |
| 262 // The GtkDrawingArea we draw the tab on. | 256 // The GtkDrawingArea we draw the tab on. |
| 263 OwnedWidgetGtk tab_; | 257 OwnedWidgetGtk tab_; |
| 264 | 258 |
| 265 // Whether we're showing the icon. It is cached so that we can detect when it | 259 // Whether we're showing the icon. It is cached so that we can detect when it |
| 266 // changes and layout appropriately. | 260 // changes and layout appropriately. |
| 267 bool showing_icon_; | 261 bool showing_icon_; |
| 268 | 262 |
| 269 // Whether we are showing the download icon. Comes from the model. | |
| 270 bool showing_download_icon_; | |
| 271 | |
| 272 // Whether we are showing the close button. It is cached so that we can | 263 // Whether we are showing the close button. It is cached so that we can |
| 273 // detect when it changes and layout appropriately. | 264 // detect when it changes and layout appropriately. |
| 274 bool showing_close_button_; | 265 bool showing_close_button_; |
| 275 | 266 |
| 276 // The offset used to animate the favicon location. | 267 // The offset used to animate the favicon location. |
| 277 int fav_icon_hiding_offset_; | 268 int fav_icon_hiding_offset_; |
| 278 | 269 |
| 279 // The animation object used to swap the favicon with the sad tab icon. | 270 // The animation object used to swap the favicon with the sad tab icon. |
| 280 scoped_ptr<FavIconCrashAnimation> crash_animation_; | 271 scoped_ptr<FavIconCrashAnimation> crash_animation_; |
| 281 | 272 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 295 // still render the old theme for this tab. | 286 // still render the old theme for this tab. |
| 296 ThemeProvider* theme_provider_; | 287 ThemeProvider* theme_provider_; |
| 297 | 288 |
| 298 // The close button. | 289 // The close button. |
| 299 scoped_ptr<CustomDrawButton> close_button_; | 290 scoped_ptr<CustomDrawButton> close_button_; |
| 300 | 291 |
| 301 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); | 292 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); |
| 302 }; | 293 }; |
| 303 | 294 |
| 304 #endif // CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ | 295 #endif // CHROME_BROWSER_GTK_TABS_TAB_RENDERER_GTK_H_ |
| OLD | NEW |