diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 03:52:11 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-19 03:52:11 +0000 |
commit | 1a6b30a619cba771cb9c4ed4da9c3778634567ad (patch) | |
tree | 4ced69ac8eb511a6f9bc7949348551ee62b57989 /chrome/browser/browser.cc | |
parent | a8815b3277284778247545728bc41a077ff55b43 (diff) | |
download | chromium_src-1a6b30a619cba771cb9c4ed4da9c3778634567ad.zip chromium_src-1a6b30a619cba771cb9c4ed4da9c3778634567ad.tar.gz chromium_src-1a6b30a619cba771cb9c4ed4da9c3778634567ad.tar.bz2 |
This changelist represents the necessary merger of two others:
http://codereview.chromium.org/172082
Create new event_utils.h file for Cocoa-specific event to WindowOpenDisposition
cracking.
Hook this up to BookmarkBarController so that clicks to bookmark items use the
oracle function to determine where the bookmark should be opened.
BUG=17301
TEST=Cmd+Click etc on bookmark items should work. See bug and unit test
attached.
http://codereview.chromium.org/174021
Convert users of the "get last active browser, get selected tab contents, open
url" pattern to just call OpenURL on Browser directly.
Makes GetOrCreateTabbedBrowser public on Browser, and makes it static so it can
be called with a provided profile.
BUG=none
TEST=Try opening links from the bookmark/history menus on mac, with and without
an existing window open, with an active incognito window, etc. The links should
all open in the last active non-incognito window, or create a new non-incognito
window if none is open.
Review URL: http://codereview.chromium.org/173044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23693 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index d72c24a..4d54c4d 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -580,7 +580,7 @@ TabContents* Browser::AddTabWithURL( } 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 @@ void Browser::NewTab() { 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 @@ void Browser::AddNewContents(TabContents* source, 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 @@ bool Browser::CanCloseWithInProgressDownloads() { /////////////////////////////////////////////////////////////////////////////// // 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 @@ void Browser::OpenURLAtIndex(TabContents* source, return; } - Browser* b = GetOrCreateTabbedBrowser(); + Browser* b = GetOrCreateTabbedBrowser(profile_); DCHECK(b); // If we have just created a new browser window, make sure we select the |