summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 00:09:47 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-12 00:09:47 +0000
commit90a8bf25708f3041c1580166e6cd6e3efff4636a (patch)
tree49d012711bcb00186c5ec307e3d36782b6b96d3f /chrome
parente6bd9f01a4ef4a1d5ffe22e0437a373a20d98fe4 (diff)
downloadchromium_src-90a8bf25708f3041c1580166e6cd6e3efff4636a.zip
chromium_src-90a8bf25708f3041c1580166e6cd6e3efff4636a.tar.gz
chromium_src-90a8bf25708f3041c1580166e6cd6e3efff4636a.tar.bz2
Open tabbed bookmark manager from menus as well.
This is the Mac part of issue 826002. BUG=37372 TEST=Start chrome with --enable-tabbed-bookmark-manage and open the BMM from the app menu, as well as bookmark bar context menu etc. All entries should take you to the tabbed bookmark manager. Review URL: http://codereview.chromium.org/871003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41361 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/app_controller_mac.mm15
-rw-r--r--chrome/browser/browser.cc7
-rw-r--r--chrome/browser/browser.h1
3 files changed, 22 insertions, 1 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index dcd90b8..d355bcb 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -670,7 +670,20 @@ void RecordLastRunAppBundlePath() {
}
case IDC_SHOW_BOOKMARK_MANAGER:
UserMetrics::RecordAction("ShowBookmarkManager", defaultProfile);
- [BookmarkManagerController showBookmarkManager:defaultProfile];
+ if (Browser* browser = ActivateBrowser(defaultProfile)) {
+ // Call through browser which takes care of opening a tab or the old
+ // bookmark manager window.
+ browser->OpenBookmarkManager();
+ } else {
+ // We have no browser window. Only create a window if we are using the
+ // new tabbed bookmark manager.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableTabbedBookmarkManager)) {
+ Browser::OpenBookmarkManagerWindow(defaultProfile);
+ } else {
+ [BookmarkManagerController showBookmarkManager:defaultProfile];
+ }
+ }
break;
case IDC_SHOW_HISTORY:
if (Browser* browser = ActivateBrowser(defaultProfile))
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 46672ec..4bec672 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -394,6 +394,13 @@ void Browser::OpenApplicationWindow(Profile* profile, const GURL& url,
#if defined(OS_MACOSX)
// static
+void Browser::OpenBookmarkManagerWindow(Profile* profile) {
+ Browser* browser = Browser::Create(profile);
+ browser->ShowBookmarkManagerTab();
+ browser->window()->Show();
+}
+
+// static
void Browser::OpenHistoryWindow(Profile* profile) {
Browser* browser = Browser::Create(profile);
browser->ShowHistoryTab();
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index f8abf95..cff63ee 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -190,6 +190,7 @@ class Browser : public TabStripModelDelegate,
#if defined(OS_MACOSX)
// Open a new window with history/downloads/help (needed on Mac when there are
// no windows).
+ static void OpenBookmarkManagerWindow(Profile* profile);
static void OpenHistoryWindow(Profile* profile);
static void OpenDownloadsWindow(Profile* profile);
static void OpenHelpWindow(Profile* profile);