Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_GTK_TABS_TAB_RENDERER_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 #include <map> | 10 #include <map> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" | |
| 15 #include "content/public/browser/notification_observer.h" | 16 #include "content/public/browser/notification_observer.h" |
| 16 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 17 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
| 18 #include "ui/base/animation/animation_delegate.h" | 19 #include "ui/base/animation/animation_delegate.h" |
| 19 #include "ui/base/gtk/gtk_signal.h" | 20 #include "ui/base/gtk/gtk_signal.h" |
| 20 #include "ui/base/gtk/owned_widget_gtk.h" | 21 #include "ui/base/gtk/owned_widget_gtk.h" |
| 21 #include "ui/gfx/canvas.h" | 22 #include "ui/gfx/canvas.h" |
| 22 #include "ui/gfx/font.h" | 23 #include "ui/gfx/font.h" |
| 23 #include "ui/gfx/rect.h" | 24 #include "ui/gfx/rect.h" |
| 24 | 25 |
| 25 namespace gfx { | 26 namespace gfx { |
| 26 class Size; | 27 class Size; |
| 27 } // namespace gfx | 28 } // namespace gfx |
| 28 | 29 |
| 30 class CairoCachedSurface; | |
| 29 class CustomDrawButton; | 31 class CustomDrawButton; |
| 30 class TabContents; | 32 class TabContents; |
| 31 class ThemeService; | 33 class GtkThemeService; |
| 32 | 34 |
| 33 namespace ui { | 35 namespace ui { |
| 34 class SlideAnimation; | 36 class SlideAnimation; |
| 35 class ThrobAnimation; | 37 class ThrobAnimation; |
| 36 } | 38 } |
| 37 | 39 |
| 38 class TabRendererGtk : public ui::AnimationDelegate, | 40 class TabRendererGtk : public ui::AnimationDelegate { |
| 39 public content::NotificationObserver { | |
| 40 public: | 41 public: |
| 41 // Possible animation states. | 42 // Possible animation states. |
| 42 enum AnimationState { | 43 enum AnimationState { |
| 43 ANIMATION_NONE, | 44 ANIMATION_NONE, |
| 44 ANIMATION_WAITING, | 45 ANIMATION_WAITING, |
| 45 ANIMATION_LOADING | 46 ANIMATION_LOADING |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 class LoadingAnimation : public content::NotificationObserver { | 49 class LoadingAnimation : public content::NotificationObserver { |
| 49 public: | 50 public: |
| 50 struct Data { | 51 struct Data { |
| 51 explicit Data(ThemeService* theme_service); | 52 explicit Data(GtkThemeService* theme_service); |
| 52 Data(int loading, int waiting, int waiting_to_loading); | 53 Data(int loading, int waiting, int waiting_to_loading); |
| 53 | 54 |
| 54 SkBitmap* waiting_animation_frames; | |
| 55 SkBitmap* loading_animation_frames; | |
| 56 int loading_animation_frame_count; | 55 int loading_animation_frame_count; |
| 57 int waiting_animation_frame_count; | 56 int waiting_animation_frame_count; |
| 58 int waiting_to_loading_frame_count_ratio; | 57 int waiting_to_loading_frame_count_ratio; |
| 59 }; | 58 }; |
| 60 | 59 |
| 61 explicit LoadingAnimation(ThemeService* theme_service); | 60 explicit LoadingAnimation(GtkThemeService* theme_service); |
| 62 | 61 |
| 63 // Used in unit tests to inject specific data. | 62 // Used in unit tests to inject specific data. |
| 64 explicit LoadingAnimation(const LoadingAnimation::Data& data); | 63 explicit LoadingAnimation(const LoadingAnimation::Data& data); |
| 65 | 64 |
| 66 virtual ~LoadingAnimation(); | 65 virtual ~LoadingAnimation(); |
| 67 | 66 |
| 68 // Advance the loading animation to the next frame, or hide the animation if | 67 // Advance the loading animation to the next frame, or hide the animation if |
| 69 // the tab isn't loading. Returns |true| if the icon area needs to be | 68 // the tab isn't loading. Returns |true| if the icon area needs to be |
| 70 // repainted. | 69 // repainted. |
| 71 bool ValidateLoadingAnimation(AnimationState animation_state); | 70 bool ValidateLoadingAnimation(AnimationState animation_state); |
| 72 | 71 |
| 73 AnimationState animation_state() const { return animation_state_; } | 72 AnimationState animation_state() const { return animation_state_; } |
| 74 int animation_frame() const { return animation_frame_; } | 73 int animation_frame() const { return animation_frame_; } |
| 75 | 74 |
| 76 const SkBitmap* waiting_animation_frames() const { | |
| 77 return data_->waiting_animation_frames; | |
| 78 } | |
| 79 const SkBitmap* loading_animation_frames() const { | |
| 80 return data_->loading_animation_frames; | |
| 81 } | |
| 82 | |
| 83 // Provide content::NotificationObserver implementation. | 75 // Provide content::NotificationObserver implementation. |
| 84 virtual void Observe(int type, | 76 virtual void Observe(int type, |
| 85 const content::NotificationSource& source, | 77 const content::NotificationSource& source, |
| 86 const content::NotificationDetails& details); | 78 const content::NotificationDetails& details); |
| 87 | 79 |
| 88 private: | 80 private: |
| 89 scoped_ptr<Data> data_; | 81 scoped_ptr<Data> data_; |
| 90 | 82 |
| 91 // Used to listen for theme change notifications. | 83 // Used to listen for theme change notifications. |
| 92 content::NotificationRegistrar registrar_; | 84 content::NotificationRegistrar registrar_; |
| 93 | 85 |
| 94 // Gives us our throbber images. | 86 // Gives us our throbber images. |
| 95 ThemeService* theme_service_; | 87 GtkThemeService* theme_service_; |
| 96 | 88 |
| 97 // Current state of the animation. | 89 // Current state of the animation. |
| 98 AnimationState animation_state_; | 90 AnimationState animation_state_; |
| 99 | 91 |
| 100 // The current index into the Animation image strip. | 92 // The current index into the Animation image strip. |
| 101 int animation_frame_; | 93 int animation_frame_; |
| 102 | 94 |
| 103 DISALLOW_COPY_AND_ASSIGN(LoadingAnimation); | 95 DISALLOW_COPY_AND_ASSIGN(LoadingAnimation); |
| 104 }; | 96 }; |
| 105 | 97 |
| 106 explicit TabRendererGtk(ThemeService* theme_service); | 98 explicit TabRendererGtk(GtkThemeService* theme_service); |
| 107 virtual ~TabRendererGtk(); | 99 virtual ~TabRendererGtk(); |
| 108 | 100 |
| 109 // TabContents. If only the loading state was updated, the loading_only flag | 101 // TabContents. If only the loading state was updated, the loading_only flag |
| 110 // should be specified. If other things change, set this flag to false to | 102 // should be specified. If other things change, set this flag to false to |
| 111 // update everything. | 103 // update everything. |
| 112 virtual void UpdateData(TabContents* contents, bool app, bool loading_only); | 104 virtual void UpdateData(TabContents* contents, bool app, bool loading_only); |
| 113 | 105 |
| 114 // Sets the blocked state of the tab. | 106 // Sets the blocked state of the tab. |
| 115 void SetBlocked(bool pinned); | 107 void SetBlocked(bool pinned); |
| 116 bool is_blocked() const; | 108 bool is_blocked() const; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 139 | 131 |
| 140 // Returns true if the Tab is selected, false otherwise. | 132 // Returns true if the Tab is selected, false otherwise. |
| 141 virtual bool IsSelected() const; | 133 virtual bool IsSelected() const; |
| 142 | 134 |
| 143 // Returns true if the Tab is visible, false otherwise. | 135 // Returns true if the Tab is visible, false otherwise. |
| 144 virtual bool IsVisible() const; | 136 virtual bool IsVisible() const; |
| 145 | 137 |
| 146 // Sets the visibility of the Tab. | 138 // Sets the visibility of the Tab. |
| 147 virtual void SetVisible(bool visible) const; | 139 virtual void SetVisible(bool visible) const; |
| 148 | 140 |
| 149 // Paints the tab into |canvas|. | 141 void Paint(GtkWidget* widget, cairo_t* cr); |
|
Evan Stade
2011/10/25 23:33:30
docs
Elliot Glaysher
2011/10/26 21:06:57
Done.
| |
| 150 virtual void Paint(gfx::Canvas* canvas); | |
| 151 | 142 |
| 152 // Paints the tab, and keeps the result server-side. The returned surface must | 143 // Paints the tab, and keeps the result server-side. The returned surface must |
| 153 // be freed with cairo_surface_destroy(). | 144 // be freed with cairo_surface_destroy(). |
| 154 virtual cairo_surface_t* PaintToSurface(); | 145 cairo_surface_t* PaintToSurface(GtkWidget* widget, cairo_t* cr); |
| 155 | 146 |
| 156 // There is no PaintNow available, so the fastest we can do is schedule a | 147 // There is no PaintNow available, so the fastest we can do is schedule a |
| 157 // paint with the windowing system. | 148 // paint with the windowing system. |
| 158 virtual void SchedulePaint(); | 149 void SchedulePaint(); |
| 159 | 150 |
| 160 // Notifies the Tab that the close button has been clicked. | 151 // Notifies the Tab that the close button has been clicked. |
| 161 virtual void CloseButtonClicked(); | 152 virtual void CloseButtonClicked(); |
| 162 | 153 |
| 163 // Sets the bounds of the tab. | 154 // Sets the bounds of the tab. |
| 164 virtual void SetBounds(const gfx::Rect& bounds); | 155 virtual void SetBounds(const gfx::Rect& bounds); |
| 165 | 156 |
| 166 // Provide NotificationObserver implementation. | |
| 167 virtual void Observe(int type, | |
| 168 const content::NotificationSource& source, | |
| 169 const content::NotificationDetails& details); | |
| 170 | |
| 171 // Advance the loading animation to the next frame, or hide the animation if | 157 // Advance the loading animation to the next frame, or hide the animation if |
| 172 // the tab isn't loading. Returns |true| if the icon area needs to be | 158 // the tab isn't loading. Returns |true| if the icon area needs to be |
| 173 // repainted. | 159 // repainted. |
| 174 bool ValidateLoadingAnimation(AnimationState animation_state); | 160 bool ValidateLoadingAnimation(AnimationState animation_state); |
| 175 | 161 |
| 176 // Repaint only the area of the tab that contains the favicon. | 162 // Repaint only the area of the tab that contains the favicon. |
| 177 void PaintFaviconArea(GdkEventExpose* event); | 163 void PaintFaviconArea(GtkWidget* widget, cairo_t* cr); |
| 178 | 164 |
| 179 // Returns whether the Tab should display a favicon. | 165 // Returns whether the Tab should display a favicon. |
| 180 bool ShouldShowIcon() const; | 166 bool ShouldShowIcon() const; |
| 181 | 167 |
| 182 // Returns the minimum possible size of a single unselected Tab. | 168 // Returns the minimum possible size of a single unselected Tab. |
| 183 static gfx::Size GetMinimumUnselectedSize(); | 169 static gfx::Size GetMinimumUnselectedSize(); |
| 184 // Returns the minimum possible size of a selected Tab. Selected tabs must | 170 // Returns the minimum possible size of a selected Tab. Selected tabs must |
| 185 // always show a close button and have a larger minimum size than unselected | 171 // always show a close button and have a larger minimum size than unselected |
| 186 // tabs. | 172 // tabs. |
| 187 static gfx::Size GetMinimumSelectedSize(); | 173 static gfx::Size GetMinimumSelectedSize(); |
| 188 // Returns the preferred size of a single Tab, assuming space is | 174 // Returns the preferred size of a single Tab, assuming space is |
| 189 // available. | 175 // available. |
| 190 static gfx::Size GetStandardSize(); | 176 static gfx::Size GetStandardSize(); |
| 191 | 177 |
| 192 // Returns the width for mini-tabs. Mini-tabs always have this width. | 178 // Returns the width for mini-tabs. Mini-tabs always have this width. |
| 193 static int GetMiniWidth(); | 179 static int GetMiniWidth(); |
| 194 | 180 |
| 195 // Loads the images to be used for the tab background. | |
| 196 static void LoadTabImages(); | |
| 197 | |
| 198 // Sets the colors used for painting text on the tabs. | 181 // Sets the colors used for painting text on the tabs. |
| 199 static void SetSelectedTitleColor(SkColor color); | 182 static void SetSelectedTitleColor(SkColor color); |
| 200 static void SetUnselectedTitleColor(SkColor color); | 183 static void SetUnselectedTitleColor(SkColor color); |
| 201 | 184 |
| 202 static gfx::Font* title_font() { return title_font_; } | 185 static gfx::Font* title_font() { return title_font_; } |
| 203 | 186 |
| 204 // Returns the bounds of the Tab. | 187 // Returns the bounds of the Tab. |
| 205 int x() const { return bounds_.x(); } | 188 int x() const { return bounds_.x(); } |
| 206 int y() const { return bounds_.y(); } | 189 int y() const { return bounds_.y(); } |
| 207 int width() const { return bounds_.width(); } | 190 int width() const { return bounds_.width(); } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 239 CHROMEGTK_CALLBACK_1(TabRendererGtk, gboolean, OnEnterNotifyEvent, | 222 CHROMEGTK_CALLBACK_1(TabRendererGtk, gboolean, OnEnterNotifyEvent, |
| 240 GdkEventCrossing*); | 223 GdkEventCrossing*); |
| 241 | 224 |
| 242 // leave-notify-event handler that signals when the mouse enters the tab. | 225 // leave-notify-event handler that signals when the mouse enters the tab. |
| 243 CHROMEGTK_CALLBACK_1(TabRendererGtk, gboolean, OnLeaveNotifyEvent, | 226 CHROMEGTK_CALLBACK_1(TabRendererGtk, gboolean, OnLeaveNotifyEvent, |
| 244 GdkEventCrossing*); | 227 GdkEventCrossing*); |
| 245 | 228 |
| 246 private: | 229 private: |
| 247 class FaviconCrashAnimation; | 230 class FaviconCrashAnimation; |
| 248 | 231 |
| 249 // The data structure used to hold cached bitmaps. We need to manually free | |
| 250 // the bitmap in CachedBitmap when we remove it from |cached_bitmaps_|. We | |
| 251 // handle this when we replace images in the map and in the destructor. | |
| 252 struct CachedBitmap { | |
| 253 int bg_offset_x; | |
| 254 int bg_offset_y; | |
| 255 SkBitmap* bitmap; | |
| 256 }; | |
| 257 typedef std::map<std::pair<const SkBitmap*, const SkBitmap*>, CachedBitmap> | |
| 258 BitmapCache; | |
| 259 | |
| 260 // Model data. We store this here so that we don't need to ask the underlying | 232 // Model data. We store this here so that we don't need to ask the underlying |
| 261 // model, which is tricky since instances of this object can outlive the | 233 // model, which is tricky since instances of this object can outlive the |
| 262 // corresponding objects in the underlying model. | 234 // corresponding objects in the underlying model. |
| 263 struct TabData { | 235 struct TabData { |
| 264 TabData() | 236 TabData(); |
| 265 : is_default_favicon(false), | 237 ~TabData(); |
| 266 loading(false), | |
| 267 crashed(false), | |
| 268 incognito(false), | |
| 269 show_icon(true), | |
| 270 mini(false), | |
| 271 blocked(false), | |
| 272 animating_mini_change(false), | |
| 273 app(false) { | |
| 274 } | |
| 275 | 238 |
| 276 SkBitmap favicon; | 239 SkBitmap favicon; |
| 240 CairoCachedSurface cairo_favicon; | |
| 277 bool is_default_favicon; | 241 bool is_default_favicon; |
| 278 string16 title; | 242 string16 title; |
| 279 bool loading; | 243 bool loading; |
| 280 bool crashed; | 244 bool crashed; |
| 281 bool incognito; | 245 bool incognito; |
| 282 bool show_icon; | 246 bool show_icon; |
| 283 bool mini; | 247 bool mini; |
| 284 bool blocked; | 248 bool blocked; |
| 285 bool animating_mini_change; | 249 bool animating_mini_change; |
| 286 bool app; | 250 bool app; |
| 287 }; | 251 }; |
| 288 | 252 |
| 289 // TODO(jhawkins): Move into TabResources class. | |
| 290 struct TabImage { | |
| 291 SkBitmap* image_l; | |
| 292 SkBitmap* image_c; | |
| 293 SkBitmap* image_r; | |
| 294 int l_width; | |
| 295 int r_width; | |
| 296 int y_offset; | |
| 297 }; | |
| 298 | |
| 299 // Overridden from ui::AnimationDelegate: | 253 // Overridden from ui::AnimationDelegate: |
| 300 virtual void AnimationProgressed(const ui::Animation* animation); | 254 virtual void AnimationProgressed(const ui::Animation* animation); |
| 301 virtual void AnimationCanceled(const ui::Animation* animation); | 255 virtual void AnimationCanceled(const ui::Animation* animation); |
| 302 virtual void AnimationEnded(const ui::Animation* animation); | 256 virtual void AnimationEnded(const ui::Animation* animation); |
| 303 | 257 |
| 304 // Starts/Stops the crash animation. | 258 // Starts/Stops the crash animation. |
| 305 void StartCrashAnimation(); | 259 void StartCrashAnimation(); |
| 306 void StopCrashAnimation(); | 260 void StopCrashAnimation(); |
| 307 | 261 |
| 308 // Return true if the crash animation is currently running. | 262 // Return true if the crash animation is currently running. |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 320 // Returns the local bounds of the tab. This returns the rect | 274 // Returns the local bounds of the tab. This returns the rect |
| 321 // {0, 0, width(), height()} for now, as we don't yet support borders. | 275 // {0, 0, width(), height()} for now, as we don't yet support borders. |
| 322 gfx::Rect GetLocalBounds(); | 276 gfx::Rect GetLocalBounds(); |
| 323 | 277 |
| 324 // Moves the close button widget within the GtkFixed container. | 278 // Moves the close button widget within the GtkFixed container. |
| 325 void MoveCloseButtonWidget(); | 279 void MoveCloseButtonWidget(); |
| 326 | 280 |
| 327 // Returns the largest of the favicon, title text, and the close button. | 281 // Returns the largest of the favicon, title text, and the close button. |
| 328 static int GetContentHeight(); | 282 static int GetContentHeight(); |
| 329 | 283 |
| 330 // A helper method for generating the masked bitmaps used to draw the curved | 284 void PaintTab(GtkWidget* widget, GdkEventExpose* event); |
| 331 // edges of tabs. We cache the generated bitmaps because they can take a | |
| 332 // long time to compute. | |
| 333 SkBitmap* GetMaskedBitmap(const SkBitmap* mask, | |
| 334 const SkBitmap* background, | |
| 335 int bg_offset_x, | |
| 336 int bg_offset_y); | |
| 337 BitmapCache cached_bitmaps_; | |
| 338 | |
| 339 // Paints the tab, minus the close button. | |
| 340 void PaintTab(GdkEventExpose* event); | |
| 341 | 285 |
| 342 // Paint various portions of the Tab | 286 // Paint various portions of the Tab |
| 343 void PaintTitle(gfx::Canvas* canvas); | 287 void PaintTitle(GtkWidget* widget, cairo_t* cr); |
| 344 void PaintIcon(gfx::Canvas* canvas); | 288 void PaintIcon(GtkWidget* widget, cairo_t* cr); |
| 345 void PaintTabBackground(gfx::Canvas* canvas); | 289 void PaintTabBackground(GtkWidget* widget, cairo_t* cr); |
| 346 void PaintInactiveTabBackground(gfx::Canvas* canvas); | 290 void PaintInactiveTabBackground(GtkWidget* widget, cairo_t* cr); |
| 347 void PaintActiveTabBackground(gfx::Canvas* canvas); | 291 void PaintActiveTabBackground(GtkWidget* widget, cairo_t* cr); |
| 348 void PaintLoadingAnimation(gfx::Canvas* canvas); | 292 void PaintLoadingAnimation(GtkWidget* widget, cairo_t* cairo); |
| 293 | |
| 294 void DrawTabBackground( | |
|
Evan Stade
2011/10/25 23:33:30
docs
| |
| 295 cairo_t* cr, | |
| 296 GtkWidget* widget, | |
| 297 CairoCachedSurface* tab_bg, | |
| 298 int offset_x, | |
| 299 int offset_y); | |
| 300 | |
| 301 void DrawTabShadow( | |
| 302 cairo_t* cr, | |
| 303 GtkWidget* widget, | |
| 304 int left_idr, | |
| 305 int center_idr, | |
| 306 int right_idr); | |
| 349 | 307 |
| 350 // Returns the number of favicon-size elements that can fit in the tab's | 308 // Returns the number of favicon-size elements that can fit in the tab's |
| 351 // current size. | 309 // current size. |
| 352 int IconCapacity() const; | 310 int IconCapacity() const; |
| 353 | 311 |
| 354 | 312 |
| 355 // Returns whether the Tab should display a close button. | 313 // Returns whether the Tab should display a close button. |
| 356 bool ShouldShowCloseBox() const; | 314 bool ShouldShowCloseBox() const; |
| 357 | 315 |
| 358 CustomDrawButton* MakeCloseButton(); | 316 CustomDrawButton* MakeCloseButton(); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 380 static void InitResources(); | 338 static void InitResources(); |
| 381 static bool initialized_; | 339 static bool initialized_; |
| 382 | 340 |
| 383 // The bounds of various sections of the display. | 341 // The bounds of various sections of the display. |
| 384 gfx::Rect favicon_bounds_; | 342 gfx::Rect favicon_bounds_; |
| 385 gfx::Rect title_bounds_; | 343 gfx::Rect title_bounds_; |
| 386 gfx::Rect close_button_bounds_; | 344 gfx::Rect close_button_bounds_; |
| 387 | 345 |
| 388 TabData data_; | 346 TabData data_; |
| 389 | 347 |
| 390 static TabImage tab_active_; | 348 static int tab_active_l_width_; |
|
Evan Stade
2011/10/25 23:33:30
docs
| |
| 391 static TabImage tab_inactive_; | 349 static int tab_active_l_height_; |
|
Evan Stade
2011/10/25 23:33:30
you might use gfx::Size here
| |
| 392 static TabImage tab_alpha_; | 350 static int tab_active_r_width_; |
| 351 static int tab_inactive_l_width_; | |
| 352 static int tab_inactive_l_height_; | |
| 353 static int tab_inactive_r_width_; | |
| 393 | 354 |
| 394 static gfx::Font* title_font_; | 355 static gfx::Font* title_font_; |
| 395 static int title_font_height_; | 356 static int title_font_height_; |
| 396 | 357 |
| 397 static int close_button_width_; | 358 static int close_button_width_; |
| 398 static int close_button_height_; | 359 static int close_button_height_; |
| 399 | 360 |
| 400 static SkColor selected_title_color_; | 361 static SkColor selected_title_color_; |
| 401 static SkColor unselected_title_color_; | 362 static SkColor unselected_title_color_; |
| 402 | 363 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 437 LoadingAnimation loading_animation_; | 398 LoadingAnimation loading_animation_; |
| 438 | 399 |
| 439 // The offset used to paint the tab theme images. | 400 // The offset used to paint the tab theme images. |
| 440 int background_offset_x_; | 401 int background_offset_x_; |
| 441 | 402 |
| 442 // The vertical offset used to paint the tab theme images. Controlled by the | 403 // The vertical offset used to paint the tab theme images. Controlled by the |
| 443 // tabstrip and plumbed here to offset the theme image by the size of the | 404 // tabstrip and plumbed here to offset the theme image by the size of the |
| 444 // alignment in the BrowserTitlebar. | 405 // alignment in the BrowserTitlebar. |
| 445 int background_offset_y_; | 406 int background_offset_y_; |
| 446 | 407 |
| 447 ThemeService* theme_service_; | 408 GtkThemeService* theme_service_; |
| 448 | 409 |
| 449 // The close button. | 410 // The close button. |
| 450 scoped_ptr<CustomDrawButton> close_button_; | 411 scoped_ptr<CustomDrawButton> close_button_; |
| 451 | 412 |
| 452 // The current color of the close button. | 413 // The current color of the close button. |
| 453 SkColor close_button_color_; | 414 SkColor close_button_color_; |
| 454 | 415 |
| 455 // Indicates whether this tab is the active one. | 416 // Indicates whether this tab is the active one. |
| 456 bool is_active_; | 417 bool is_active_; |
| 457 | 418 |
| 458 // Used to listen for theme change notifications. | |
| 459 content::NotificationRegistrar registrar_; | |
| 460 | |
| 461 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); | 419 DISALLOW_COPY_AND_ASSIGN(TabRendererGtk); |
| 462 }; | 420 }; |
| 463 | 421 |
| 464 #endif // CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ | 422 #endif // CHROME_BROWSER_UI_GTK_TABS_TAB_RENDERER_GTK_H_ |
| OLD | NEW |