summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_commands.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/browser_commands.cc')
-rw-r--r--chrome/browser/browser_commands.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc
index 0f01548..a4df1c1 100644
--- a/chrome/browser/browser_commands.cc
+++ b/chrome/browser/browser_commands.cc
@@ -25,6 +25,8 @@
#include "chrome/browser/task_manager.h"
#include "chrome/browser/user_metrics.h"
#include "chrome/browser/views/about_chrome_view.h"
+#include "chrome/browser/views/bookmark_bar_view.h"
+#include "chrome/browser/views/bookmark_manager_view.h"
#include "chrome/browser/views/bug_report_view.h"
#include "chrome/browser/views/clear_browsing_data.h"
#include "chrome/browser/views/importer_view.h"
@@ -104,6 +106,7 @@ void Browser::InitCommandState() {
controller_.UpdateCommandEnabled(IDC_ABOUT, true);
controller_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true);
controller_.UpdateCommandEnabled(IDC_SHOW_BOOKMARKS_BAR, true);
+ controller_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true);
controller_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true);
controller_.UpdateCommandEnabled(IDC_ENCODING, true);
controller_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true);
@@ -650,22 +653,15 @@ void Browser::ExecuteCommand(int id) {
DuplicateContentsAt(selected_index());
break;
- case IDC_SHOW_BOOKMARKS_BAR: {
+ case IDC_SHOW_BOOKMARKS_BAR:
UserMetrics::RecordAction(L"ShowBookmarksBar", profile_);
+ BookmarkBarView::ToggleWhenVisible(profile_);
+ break;
- // Invert the current pref.
- PrefService* prefs = profile_->GetPrefs();
- prefs->SetBoolean(prefs::kShowBookmarkBar,
- !prefs->GetBoolean(prefs::kShowBookmarkBar));
- prefs->ScheduleSavePersistentPrefs(g_browser_process->file_thread());
-
- // And notify the notification service.
- Source<Profile> source(profile_);
- NotificationService::current()->Notify(
- NOTIFY_BOOKMARK_BAR_VISIBILITY_PREF_CHANGED, source,
- NotificationService::NoDetails());
+ case IDC_SHOW_BOOKMARK_MANAGER:
+ UserMetrics::RecordAction(L"ShowBookmarkManager", profile_);
+ BookmarkManagerView::Show(profile_);
break;
- }
case IDC_SHOW_HISTORY:
UserMetrics::RecordAction(L"ShowHistory", profile_);