diff options
author | melevin@chromium.org <melevin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-14 03:18:07 +0000 |
---|---|---|
committer | melevin@chromium.org <melevin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-14 03:18:07 +0000 |
commit | 3d6a895ab78ba4fbd121e786163ff118aaf76e11 (patch) | |
tree | 48d7c57b18df08d75a3570e1a88b0836e17840c9 /chrome/browser/ui | |
parent | 2bd87208406d93d11febd908a3ce950fda276309 (diff) | |
download | chromium_src-3d6a895ab78ba4fbd121e786163ff118aaf76e11.zip chromium_src-3d6a895ab78ba4fbd121e786163ff118aaf76e11.tar.gz chromium_src-3d6a895ab78ba4fbd121e786163ff118aaf76e11.tar.bz2 |
Commit the Instant preview when a tab loses focus. See b/6367695.
Review URL: https://chromiumcodereview.appspot.com/11137027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173063 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/ui/browser_instant_controller.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/browser_instant_controller.h | 3 |
3 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index bd0c8f6..23e2e75 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1094,6 +1094,9 @@ void Browser::TabDeactivated(WebContents* contents) { // Save what the user's currently typing, so it can be restored when we // switch back to this tab. window_->GetLocationBar()->SaveStateToContents(contents); + + if (instant_controller_) + instant_controller_->TabDeactivated(contents); } void Browser::ActiveTabChanged(WebContents* old_contents, diff --git a/chrome/browser/ui/browser_instant_controller.cc b/chrome/browser/ui/browser_instant_controller.cc index ba89cdf..30df1b6 100644 --- a/chrome/browser/ui/browser_instant_controller.cc +++ b/chrome/browser/ui/browser_instant_controller.cc @@ -147,6 +147,10 @@ void BrowserInstantController::ActiveTabChanged() { instant_.ActiveTabChanged(); } +void BrowserInstantController::TabDeactivated(content::WebContents* contents) { + instant_.TabDeactivated(contents); +} + void BrowserInstantController::SetContentHeight(int height) { OnThemeAreaHeightChanged(height); } diff --git a/chrome/browser/ui/browser_instant_controller.h b/chrome/browser/ui/browser_instant_controller.h index 401cfbd..570c334 100644 --- a/chrome/browser/ui/browser_instant_controller.h +++ b/chrome/browser/ui/browser_instant_controller.h @@ -76,6 +76,9 @@ class BrowserInstantController : public content::NotificationObserver, // Invoked by |browser_| when the active tab changes. void ActiveTabChanged(); + // Invoked by |browser_| when the active tab is about to be deactivated. + void TabDeactivated(content::WebContents* contents); + // Invoked by |BrowserWindow| during layout to set content height which is // used as theme area height, i.e. the height of the area that the entire // theme background image should fill up. |