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

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 6028010: Fixes bug in handling of openning background tabs by way of clicking (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nuke IsPopupOpen. Created 9 years, 11 months 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
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/ui/browser.h" 5 #include "chrome/browser/ui/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 4144 matching lines...) Expand 10 before | Expand all | Expand 10 after
4155 const TabContents* base_tab_contents, 4155 const TabContents* base_tab_contents,
4156 SessionStorageNamespace* session_storage_namespace) { 4156 SessionStorageNamespace* session_storage_namespace) {
4157 TabContents* new_contents = new TabContents(profile, site_instance, 4157 TabContents* new_contents = new TabContents(profile, site_instance,
4158 routing_id, base_tab_contents, 4158 routing_id, base_tab_contents,
4159 session_storage_namespace); 4159 session_storage_namespace);
4160 TabContentsWrapper* wrapper = new TabContentsWrapper(new_contents); 4160 TabContentsWrapper* wrapper = new TabContentsWrapper(new_contents);
4161 return wrapper; 4161 return wrapper;
4162 } 4162 }
4163 4163
4164 bool Browser::OpenInstant(WindowOpenDisposition disposition) { 4164 bool Browser::OpenInstant(WindowOpenDisposition disposition) {
4165 if (!instant() || !instant()->is_active() || !instant()->IsCurrent()) 4165 if (!instant() || !instant()->is_active() || !instant()->IsCurrent() ||
4166 disposition == NEW_BACKGROUND_TAB) {
4167 // NEW_BACKGROUND_TAB results in leaving the omnibox open, so we don't
4168 // attempt to use the instant preview.
4166 return false; 4169 return false;
4170 }
4167 4171
4168 if (disposition == CURRENT_TAB) { 4172 if (disposition == CURRENT_TAB) {
4169 instant()->CommitCurrentPreview(INSTANT_COMMIT_PRESSED_ENTER); 4173 instant()->CommitCurrentPreview(INSTANT_COMMIT_PRESSED_ENTER);
4170 return true; 4174 return true;
4171 } 4175 }
4172 if (disposition == NEW_FOREGROUND_TAB || disposition == NEW_BACKGROUND_TAB) { 4176 if (disposition == NEW_FOREGROUND_TAB) {
4173 TabContentsWrapper* preview_contents = instant()->ReleasePreviewContents( 4177 TabContentsWrapper* preview_contents = instant()->ReleasePreviewContents(
4174 INSTANT_COMMIT_PRESSED_ENTER); 4178 INSTANT_COMMIT_PRESSED_ENTER);
4175 // HideInstant is invoked after release so that InstantController is not 4179 // HideInstant is invoked after release so that InstantController is not
4176 // active when HideInstant asks it for its state. 4180 // active when HideInstant asks it for its state.
4177 HideInstant(); 4181 HideInstant();
4178 preview_contents->controller().PruneAllButActive(); 4182 preview_contents->controller().PruneAllButActive();
4179 tab_handler_->GetTabStripModel()->AddTabContents( 4183 tab_handler_->GetTabStripModel()->AddTabContents(
4180 preview_contents, 4184 preview_contents,
4181 -1, 4185 -1,
4182 instant()->last_transition_type(), 4186 instant()->last_transition_type(),
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
4250 // The page transition below is only for the purpose of inserting the tab. 4254 // The page transition below is only for the purpose of inserting the tab.
4251 browser->AddTab(view_source_contents, PageTransition::LINK); 4255 browser->AddTab(view_source_contents, PageTransition::LINK);
4252 } 4256 }
4253 4257
4254 if (profile_->HasSessionService()) { 4258 if (profile_->HasSessionService()) {
4255 SessionService* session_service = profile_->GetSessionService(); 4259 SessionService* session_service = profile_->GetSessionService();
4256 if (session_service) 4260 if (session_service)
4257 session_service->TabRestored(&view_source_contents->controller(), false); 4261 session_service->TabRestored(&view_source_contents->controller(), false);
4258 } 4262 }
4259 } 4263 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/location_bar_view_gtk.cc ('k') | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698