summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);