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

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: 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 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 the current location bar state, but only if the tab being detached
4014 window_->GetLocationBar()->SaveStateToContents(contents); 4014 // is the selected tab. Because saving state can conditionally revert the
4015 // location bar, saving the current tab's location bar state to a
4016 // non-selected tab can corrupt both tabs.
4017 if (contents == GetSelectedTabContents())
4018 window_->GetLocationBar()->SaveStateToContents(contents);
4015 4019
4016 if (!tab_handler_->GetTabStripModel()->closing_all()) 4020 if (!tab_handler_->GetTabStripModel()->closing_all())
4017 SyncHistoryWithTabs(0); 4021 SyncHistoryWithTabs(0);
4018 } 4022 }
4019 4023
4020 contents->set_delegate(NULL); 4024 contents->set_delegate(NULL);
4021 RemoveScheduledUpdatesFor(contents); 4025 RemoveScheduledUpdatesFor(contents);
4022 4026
4023 if (find_bar_controller_.get() && 4027 if (find_bar_controller_.get() &&
4024 index == tab_handler_->GetTabStripModel()->selected_index()) { 4028 index == tab_handler_->GetTabStripModel()->selected_index()) {
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
4094 NOTREACHED(); 4098 NOTREACHED();
4095 return false; 4099 return false;
4096 } 4100 }
4097 4101
4098 void Browser::CreateInstantIfNecessary() { 4102 void Browser::CreateInstantIfNecessary() {
4099 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && 4103 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) &&
4100 !profile()->IsOffTheRecord()) { 4104 !profile()->IsOffTheRecord()) {
4101 instant_.reset(new InstantController(profile_, this)); 4105 instant_.reset(new InstantController(profile_, this));
4102 } 4106 }
4103 } 4107 }
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