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

Side by Side Diff: chrome/browser/bookmarks/chrome_bookmark_client.cc

Issue 302313005: Show the Managed Bookmarks folder in the views UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased on model changes Created 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bookmarks/chrome_bookmark_client.h" 5 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 } 174 }
175 175
176 bool ChromeBookmarkClient::CanSyncNode(const BookmarkNode* node) { 176 bool ChromeBookmarkClient::CanSyncNode(const BookmarkNode* node) {
177 return !IsDescendantOfManagedNode(node); 177 return !IsDescendantOfManagedNode(node);
178 } 178 }
179 179
180 bool ChromeBookmarkClient::CanReorderChildren(const BookmarkNode* parent) { 180 bool ChromeBookmarkClient::CanReorderChildren(const BookmarkNode* parent) {
181 return !IsDescendantOfManagedNode(parent); 181 return !IsDescendantOfManagedNode(parent);
182 } 182 }
183 183
184 bool ChromeBookmarkClient::CanBeEditedByUser(const BookmarkNode* node) {
185 return !IsDescendantOfManagedNode(node);
186 }
187
184 void ChromeBookmarkClient::Observe( 188 void ChromeBookmarkClient::Observe(
185 int type, 189 int type,
186 const content::NotificationSource& source, 190 const content::NotificationSource& source,
187 const content::NotificationDetails& details) { 191 const content::NotificationDetails& details) {
188 switch (type) { 192 switch (type) {
189 case chrome::NOTIFICATION_FAVICON_CHANGED: { 193 case chrome::NOTIFICATION_FAVICON_CHANGED: {
190 content::Details<FaviconChangedDetails> favicon_details(details); 194 content::Details<FaviconChangedDetails> favicon_details(details);
191 model_->OnFaviconChanged(favicon_details->urls); 195 model_->OnFaviconChanged(favicon_details->urls);
192 break; 196 break;
193 } 197 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 return extra_nodes.Pass(); 254 return extra_nodes.Pass();
251 } 255 }
252 256
253 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { 257 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() {
254 policy::ProfilePolicyConnector* connector = 258 policy::ProfilePolicyConnector* connector =
255 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_); 259 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_);
256 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) 260 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks))
257 return connector->GetManagementDomain(); 261 return connector->GetManagementDomain();
258 return std::string(); 262 return std::string();
259 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698