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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm

Issue 12550006: Mac: Add a shortcut to open the Apps page from the bookmark bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Minor typo. Created 7 years, 9 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
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm
index 92b60df3f20e200110eae0447c0b75ca6e3d7822..e9e0268c2762a3f92c33bf8d1ceca374cf4f2b4e 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm
@@ -4,10 +4,16 @@
#include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h"
+#include "base/bind.h"
+#include "base/prefs/pref_service.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
+#include "chrome/common/pref_names.h"
-BookmarkBarBridge::BookmarkBarBridge(BookmarkBarController* controller,
+
+BookmarkBarBridge::BookmarkBarBridge(Profile* profile,
+ BookmarkBarController* controller,
BookmarkModel* model)
: controller_(controller),
model_(model),
@@ -18,6 +24,12 @@ BookmarkBarBridge::BookmarkBarBridge(BookmarkBarController* controller,
// We will be notified when that happens with the AddObserver() call.
if (model->IsLoaded())
Loaded(model, false);
+
+ profile_pref_registrar_.Init(profile->GetPrefs());
+ profile_pref_registrar_.Add(
+ prefs::kShowAppsShortcutInBookmarkBar,
+ base::Bind(&BookmarkBarBridge::OnAppsPageShortcutVisibilityChanged,
+ base::Unretained(this)));
}
BookmarkBarBridge::~BookmarkBarBridge() {
@@ -81,3 +93,7 @@ void BookmarkBarBridge::ExtensiveBookmarkChangesEnded(BookmarkModel* model) {
batch_mode_ = false;
[controller_ loaded:model];
}
+
+void BookmarkBarBridge::OnAppsPageShortcutVisibilityChanged() {
+ [controller_ updateAppsPageShortcutButtonVisibility];
+}

Powered by Google App Engine
This is Rietveld 408576698