diff options
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 10 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 4 |
3 files changed, 12 insertions, 6 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 183b0b2..62fdb47 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1111,7 +1111,7 @@ void BrowserWindowGtk::Paste() { void BrowserWindowGtk::PrepareForInstant() { TabContents* contents = contents_container_->GetTabContents(); if (contents) - contents->FadeForInstant(); + contents->FadeForInstant(true); } void BrowserWindowGtk::ShowInstant(TabContents* preview_contents) { @@ -1127,7 +1127,13 @@ void BrowserWindowGtk::HideInstant(bool instant_is_active) { contents_container_->PopPreviewContents(); MaybeShowBookmarkBar(false); - // TODO(sky): honor instant_is_active. + TabContents* contents = contents_container_->GetTabContents(); + if (contents) { + if (instant_is_active) + contents->FadeForInstant(false); + else + contents->CancelInstantFade(); + } } gfx::Rect BrowserWindowGtk::GetInstantBounds() { diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 3aeb4e0..01dac82 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -801,11 +801,11 @@ void TabContents::DidBecomeSelected() { last_selected_time_ = base::TimeTicks::Now(); } -void TabContents::FadeForInstant() { +void TabContents::FadeForInstant(bool animate) { RenderWidgetHostView* rwhv = GetRenderWidgetHostView(); SkColor whitish = SkColorSetARGB(192, 255, 255, 255); if (rwhv) - rwhv->SetVisuallyDeemphasized(&whitish, true); + rwhv->SetVisuallyDeemphasized(&whitish, animate); } void TabContents::CancelInstantFade() { diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index c5448c8..78653c6 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -737,8 +737,8 @@ class TabContents : public PageNavigator, int GetZoomPercent(bool* enable_increment, bool* enable_decrement); // Shows a fade effect over this tab contents. Repeated calls will be ignored - // until the fade is canceled. - void FadeForInstant(); + // until the fade is canceled. If |animate| is true the fade should animate. + void FadeForInstant(bool animate); // Immediately removes the fade. void CancelInstantFade(); |