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

Side by Side 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: Add comment and save state for closing tabs too. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <shellapi.h> 8 #include <shellapi.h>
9 #include <windows.h> 9 #include <windows.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 3992 matching lines...) Expand 10 before | Expand all | Expand 10 after
4003 } 4003 }
4004 } 4004 }
4005 4005
4006 void Browser::CloseFrame() { 4006 void Browser::CloseFrame() {
4007 window_->Close(); 4007 window_->Close();
4008 } 4008 }
4009 4009
4010 void Browser::TabDetachedAtImpl(TabContents* contents, int index, 4010 void Browser::TabDetachedAtImpl(TabContents* contents, int index,
4011 DetachType type) { 4011 DetachType type) {
4012 if (type == DETACH_TYPE_DETACH) { 4012 if (type == DETACH_TYPE_DETACH) {
4013 // Save what the user's currently typed. 4013 // 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.
4014 window_->GetLocationBar()->SaveStateToContents(contents); 4014 // selected tab is detaching, because what the user typed would have been
4015 // for the selected tab.
4016 if (contents == GetSelectedTabContents())
4017 window_->GetLocationBar()->SaveStateToContents(contents);
4015 4018
4016 if (!tab_handler_->GetTabStripModel()->closing_all()) 4019 if (!tab_handler_->GetTabStripModel()->closing_all())
4017 SyncHistoryWithTabs(0); 4020 SyncHistoryWithTabs(0);
4018 } 4021 }
4019 4022
4020 contents->set_delegate(NULL); 4023 contents->set_delegate(NULL);
4021 RemoveScheduledUpdatesFor(contents); 4024 RemoveScheduledUpdatesFor(contents);
4022 4025
4023 if (find_bar_controller_.get() && 4026 if (find_bar_controller_.get() &&
4024 index == tab_handler_->GetTabStripModel()->selected_index()) { 4027 index == tab_handler_->GetTabStripModel()->selected_index()) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
4094 NOTREACHED(); 4097 NOTREACHED();
4095 return false; 4098 return false;
4096 } 4099 }
4097 4100
4098 void Browser::CreateInstantIfNecessary() { 4101 void Browser::CreateInstantIfNecessary() {
4099 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && 4102 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) &&
4100 !profile()->IsOffTheRecord()) { 4103 !profile()->IsOffTheRecord()) {
4101 instant_.reset(new InstantController(profile_, this)); 4104 instant_.reset(new InstantController(profile_, this));
4102 } 4105 }
4103 } 4106 }
OLDNEW
« 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