Chromium Code Reviews| Index: chrome/browser/ui/browser.cc |
| diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
| index 3d8f3c58817471e6b3de4e7720c35a2efc163ddc..805857232a1a7ae35bf21358f0999a3bc448ca80 100644 |
| --- a/chrome/browser/ui/browser.cc |
| +++ b/chrome/browser/ui/browser.cc |
| @@ -4010,8 +4010,11 @@ 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 what the user has typed in the location bar. But do this only if the |
|
Peter Kasting
2010/11/17 01:41:24
Nit: Might be clearer as:
// Save the current loc
sadrul
2010/11/17 02:09:24
Done.
|
| + // selected tab is detaching, because what the user typed would have been |
| + // for the selected tab. |
| + if (contents == GetSelectedTabContents()) |
| + window_->GetLocationBar()->SaveStateToContents(contents); |
| if (!tab_handler_->GetTabStripModel()->closing_all()) |
| SyncHistoryWithTabs(0); |