diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 04:16:03 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-16 04:16:03 +0000 |
commit | a94454b8a871d06ff2f645bd70b558e2591f4195 (patch) | |
tree | 246b5aab17cc99e74126dfb17d82c541ca373978 | |
parent | 0e9e40293244c1e0d5c845efee2f642bb6559b63 (diff) | |
download | chromium_src-a94454b8a871d06ff2f645bd70b558e2591f4195.zip chromium_src-a94454b8a871d06ff2f645bd70b558e2591f4195.tar.gz chromium_src-a94454b8a871d06ff2f645bd70b558e2591f4195.tar.bz2 |
Makes linux honor instant_is_active when instant temporarily hides.
BUG=66720
TEST=see bug
Review URL: http://codereview.chromium.org/5906001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69373 0039d316-1c4b-4281-b951-d872f2087c98
-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(); |