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

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

Issue 308273002: Made the bookmarks extension APIs aware of managed bookmarks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 ChromeBookmarkClient::~ChromeBookmarkClient() { 62 ChromeBookmarkClient::~ChromeBookmarkClient() {
63 model_->RemoveObserver(this); 63 model_->RemoveObserver(this);
64 64
65 registrar_.RemoveAll(); 65 registrar_.RemoveAll();
66 } 66 }
67 67
68 bool ChromeBookmarkClient::IsDescendantOfManagedNode(const BookmarkNode* node) { 68 bool ChromeBookmarkClient::IsDescendantOfManagedNode(const BookmarkNode* node) {
69 return node && node->HasAncestor(managed_node_); 69 return node && node->HasAncestor(managed_node_);
70 } 70 }
71 71
72 bool ChromeBookmarkClient::HasDescendantsOfManagedNode(
73 const std::vector<const BookmarkNode*>& list) {
74 for (size_t i = 0; i < list.size(); ++i) {
75 if (IsDescendantOfManagedNode(list[i]))
76 return true;
77 }
78 return false;
79 }
80
72 bool ChromeBookmarkClient::PreferTouchIcon() { 81 bool ChromeBookmarkClient::PreferTouchIcon() {
73 #if !defined(OS_IOS) 82 #if !defined(OS_IOS)
74 return false; 83 return false;
75 #else 84 #else
76 return true; 85 return true;
77 #endif 86 #endif
78 } 87 }
79 88
80 base::CancelableTaskTracker::TaskId ChromeBookmarkClient::GetFaviconImageForURL( 89 base::CancelableTaskTracker::TaskId ChromeBookmarkClient::GetFaviconImageForURL(
81 const GURL& page_url, 90 const GURL& page_url,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 return extra_nodes.Pass(); 250 return extra_nodes.Pass();
242 } 251 }
243 252
244 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { 253 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() {
245 policy::ProfilePolicyConnector* connector = 254 policy::ProfilePolicyConnector* connector =
246 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_); 255 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_);
247 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) 256 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks))
248 return connector->GetManagementDomain(); 257 return connector->GetManagementDomain();
249 return std::string(); 258 return std::string();
250 } 259 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/chrome_bookmark_client.h ('k') | chrome/browser/bookmarks/chrome_bookmark_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698