Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3669)

Unified Diff: chrome/browser/ui/browser.cc

Issue 5075001: Fix omnibox update bug. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update comment as per Peter's suggestion Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 3d8f3c58817471e6b3de4e7720c35a2efc163ddc..9a0e61140918411bb4c9f0b3931c465a1880821f 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -4010,8 +4010,12 @@ void Browser::CloseFrame() {
void Browser::TabDetachedAtImpl(TabContents* contents, int index,
DetachType type) {
if (type == DETACH_TYPE_DETACH) {
- // Save what the user's currently typed.
- window_->GetLocationBar()->SaveStateToContents(contents);
+ // Save the current location bar state, but only if the tab being detached
+ // is the selected tab. Because saving state can conditionally revert the
+ // location bar, saving the current tab's location bar state to a
+ // non-selected tab can corrupt both tabs.
+ if (contents == GetSelectedTabContents())
+ window_->GetLocationBar()->SaveStateToContents(contents);
if (!tab_handler_->GetTabStripModel()->closing_all())
SyncHistoryWithTabs(0);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698