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

Unified Diff: chrome/browser/browser.cc

Issue 174021: Convert users of the "get last active browser, get selected tab contents, ope... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/cocoa/bookmark_menu_cocoa_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 23676)
+++ chrome/browser/browser.cc (working copy)
@@ -580,7 +580,7 @@
} else {
// We're in an app window or a popup window. Find an existing browser to
// open this URL in, creating one if none exists.
- Browser* b = GetOrCreateTabbedBrowser();
+ Browser* b = GetOrCreateTabbedBrowser(profile_);
contents = b->AddTabWithURL(url, referrer, transition, foreground, index,
force_index, instance);
b->window()->Show();
@@ -832,7 +832,7 @@
if (type() == TYPE_NORMAL) {
AddBlankTab(true);
} else {
- Browser* b = GetOrCreateTabbedBrowser();
+ Browser* b = GetOrCreateTabbedBrowser(profile_);
b->AddBlankTab(true);
b->window()->Show();
// The call to AddBlankTab above did not set the focus to the tab as its
@@ -1779,7 +1779,7 @@
if (tabstrip_model_.count() > 0 &&
disposition != NEW_WINDOW && disposition != NEW_POPUP &&
type_ != TYPE_NORMAL) {
- Browser* b = GetOrCreateTabbedBrowser();
+ Browser* b = GetOrCreateTabbedBrowser(profile_);
DCHECK(b);
PageTransition::Type transition = PageTransition::LINK;
// If we were called from an "installed webapp" we want to emulate the code
@@ -2585,11 +2585,12 @@
///////////////////////////////////////////////////////////////////////////////
// Browser, Assorted utility functions (private):
-Browser* Browser::GetOrCreateTabbedBrowser() {
+// static
+Browser* Browser::GetOrCreateTabbedBrowser(Profile* profile) {
Browser* browser = BrowserList::FindBrowserWithType(
- profile_, TYPE_NORMAL);
+ profile, TYPE_NORMAL);
if (!browser)
- browser = Browser::Create(profile_);
+ browser = Browser::Create(profile);
return browser;
}
@@ -2637,7 +2638,7 @@
return;
}
- Browser* b = GetOrCreateTabbedBrowser();
+ Browser* b = GetOrCreateTabbedBrowser(profile_);
DCHECK(b);
// If we have just created a new browser window, make sure we select the
« no previous file with comments | « chrome/browser/browser.h ('k') | chrome/browser/cocoa/bookmark_menu_cocoa_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698