diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 18:41:11 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 18:41:11 +0000 |
commit | a5ee9b843ad5ac147ef4180fd7549d0024463717 (patch) | |
tree | 5b7dfbd8de95b4245398993e1b18f418e289b059 | |
parent | 52db4aa7aa9a340e8b142816aca9ad873f9c9043 (diff) | |
download | chromium_src-a5ee9b843ad5ac147ef4180fd7549d0024463717.zip chromium_src-a5ee9b843ad5ac147ef4180fd7549d0024463717.tar.gz chromium_src-a5ee9b843ad5ac147ef4180fd7549d0024463717.tar.bz2 |
GTK: Use correct tabstrip background in Incognito mode.
http://crbug.com/12421
Review URL: http://codereview.chromium.org/115642
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16630 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.cc | 10 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/tab_strip_gtk.h | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 6d9ae73..0f65c07 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -34,8 +34,6 @@ const int kHorizontalMoveThreshold = 16; // pixels // which results in overlapping tabs. const int kTabHOffset = -16; -SkBitmap* background = NULL; - inline int Round(double x) { return static_cast<int>(x + 0.5); } @@ -455,9 +453,9 @@ void TabStripGtk::Init(int width, Profile* profile) { model_->AddObserver(this); - if (!background) { - background = theme_provider->GetBitmapNamed(IDR_THEME_FRAME); - } + int background_type = profile->IsOffTheRecord() ? + IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME; + background_ = theme_provider->GetBitmapNamed(background_type); tabstrip_.Own(gtk_fixed_new()); gtk_fixed_set_has_window(GTK_FIXED(tabstrip_.get()), TRUE); @@ -1062,7 +1060,7 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget, TabStripGtk* tabstrip) { void TabStripGtk::PaintBackground(GdkEventExpose* event) { gfx::CanvasPaint canvas(event); - canvas.TileImageInt(*background, 0, 0, bounds_.width(), bounds_.height()); + canvas.TileImageInt(*background_, 0, 0, bounds_.width(), bounds_.height()); } void TabStripGtk::SetTabBounds(TabGtk* tab, const gfx::Rect& bounds) { diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h index d5b1244..af4817b 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.h +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h @@ -223,6 +223,9 @@ class TabStripGtk : public TabStripModelObserver, // Our model. TabStripModel* model_; + // The bitmap we use to paint the colored background. + SkBitmap* background_; + // The currently running animation. scoped_ptr<TabAnimation> active_animation_; |