diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:22:03 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 21:22:03 +0000 |
commit | 85ff2c48df0789ae2476cd85738e07cecae9b3e3 (patch) | |
tree | d5a15f916376146d8626b92d97556c80627c9d0c /chrome/browser/browser.cc | |
parent | e2eb43115440dc442b92c5842274290caedb146f (diff) | |
download | chromium_src-85ff2c48df0789ae2476cd85738e07cecae9b3e3.zip chromium_src-85ff2c48df0789ae2476cd85738e07cecae9b3e3.tar.gz chromium_src-85ff2c48df0789ae2476cd85738e07cecae9b3e3.tar.bz2 |
Revert the Omnibox when changing tabs while its contents have been deleted.
To do this, I needed to add a new TabStripModelObserver call that fired before the tab had been changed, since when the Omnibox asks for the current permanent_text_ it gets it from the selected tab's navigation controller.
BUG=6850
Review URL: http://codereview.chromium.org/113983
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17241 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index bdb7fca..8ec46f1 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1583,6 +1583,12 @@ void Browser::TabDetachedAt(TabContents* contents, int index) { Source<TabContents>(contents)); } +void Browser::TabDeselectedAt(TabContents* contents, int index) { + // Save what the user's currently typing, so it can be restored when we + // switch back to this tab. + window_->GetLocationBar()->SaveStateToContents(contents); +} + void Browser::TabSelectedAt(TabContents* old_contents, TabContents* new_contents, int index, @@ -1593,12 +1599,6 @@ void Browser::TabSelectedAt(TabContents* old_contents, if (!chrome_updater_factory_.empty() && old_contents) ProcessPendingUIUpdates(); - if (old_contents) { - // Save what the user's currently typing, so it can be restored when we - // switch back to this tab. - window_->GetLocationBar()->SaveStateToContents(old_contents); - } - // Propagate the profile to the location bar. UpdateToolbar(true); |