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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.mm

Issue 16172005: Clean up async app launcher enabled checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" 5 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h"
6 6
7 #include "apps/app_launcher.h" 7 #include "apps/app_launcher.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 14 matching lines...) Expand all
25 // We will be notified when that happens with the AddObserver() call. 25 // We will be notified when that happens with the AddObserver() call.
26 if (model->loaded()) 26 if (model->loaded())
27 Loaded(model, false); 27 Loaded(model, false);
28 28
29 profile_pref_registrar_.Init(profile->GetPrefs()); 29 profile_pref_registrar_.Init(profile->GetPrefs());
30 profile_pref_registrar_.Add( 30 profile_pref_registrar_.Add(
31 prefs::kShowAppsShortcutInBookmarkBar, 31 prefs::kShowAppsShortcutInBookmarkBar,
32 base::Bind(&BookmarkBarBridge::OnAppsPageShortcutVisibilityPrefChanged, 32 base::Bind(&BookmarkBarBridge::OnAppsPageShortcutVisibilityPrefChanged,
33 base::Unretained(this))); 33 base::Unretained(this)));
34 34
35 // The first check for the app launcher is asynchronous, run it now. 35 [controller_ updateAppsPageShortcutButtonVisibility];
36 apps::GetIsAppLauncherEnabled(
37 base::Bind(&BookmarkBarBridge::OnAppLauncherEnabledCompleted,
38 base::Unretained(this)));
39 } 36 }
40 37
41 BookmarkBarBridge::~BookmarkBarBridge() { 38 BookmarkBarBridge::~BookmarkBarBridge() {
42 model_->RemoveObserver(this); 39 model_->RemoveObserver(this);
43 } 40 }
44 41
45 void BookmarkBarBridge::Loaded(BookmarkModel* model, bool ids_reassigned) { 42 void BookmarkBarBridge::Loaded(BookmarkModel* model, bool ids_reassigned) {
46 [controller_ loaded:model]; 43 [controller_ loaded:model];
47 } 44 }
48 45
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 97 }
101 98
102 void BookmarkBarBridge::ExtensiveBookmarkChangesEnded(BookmarkModel* model) { 99 void BookmarkBarBridge::ExtensiveBookmarkChangesEnded(BookmarkModel* model) {
103 batch_mode_ = false; 100 batch_mode_ = false;
104 [controller_ loaded:model]; 101 [controller_ loaded:model];
105 } 102 }
106 103
107 void BookmarkBarBridge::OnAppsPageShortcutVisibilityPrefChanged() { 104 void BookmarkBarBridge::OnAppsPageShortcutVisibilityPrefChanged() {
108 [controller_ updateAppsPageShortcutButtonVisibility]; 105 [controller_ updateAppsPageShortcutButtonVisibility];
109 } 106 }
110
111 void BookmarkBarBridge::OnAppLauncherEnabledCompleted(
koz (OOO until 15th September) 2013/05/30 04:08:40 The declaration of this function can be removed no
calamity 2013/05/31 01:15:22 Done.
112 bool app_launcher_enabled) {
113 [controller_ updateAppsPageShortcutButtonVisibility];
114 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698