Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 chrome::NOTIFICATION_FAVICON_CHANGED, | 58 chrome::NOTIFICATION_FAVICON_CHANGED, |
| 59 content::Source<Profile>(profile_)); | 59 content::Source<Profile>(profile_)); |
| 60 } | 60 } |
| 61 | 61 |
| 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::IsAManagedNode(const BookmarkNode* node) { | 68 bool ChromeBookmarkClient::IsAManagedNode(const BookmarkNode* node) { |
|
not at google - send to devlin
2014/06/05 17:16:36
IsA* is a bit odd, Is* is more typical.
sky
2014/06/05 18:13:20
I still prefer IsDescendantOfManagedNode.
Joao da Silva
2014/06/05 18:58:17
Renamed at the parent CL (https://codereview.chrom
Joao da Silva
2014/06/05 18:58:17
IsManagedNode() can also be interpreted as node ==
| |
| 69 return node && node->HasAncestor(managed_node_); | 69 return node && node->HasAncestor(managed_node_); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool ChromeBookmarkClient::HasManagedNodes( | |
| 73 const std::vector<const BookmarkNode*>& list) { | |
| 74 for (size_t i = 0; i < list.size(); ++i) { | |
| 75 if (IsAManagedNode(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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 240 return extra_nodes.Pass(); | 249 return extra_nodes.Pass(); |
| 241 } | 250 } |
| 242 | 251 |
| 243 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { | 252 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { |
| 244 policy::ProfilePolicyConnector* connector = | 253 policy::ProfilePolicyConnector* connector = |
| 245 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_); | 254 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_); |
| 246 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) | 255 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) |
| 247 return connector->GetManagementDomain(); | 256 return connector->GetManagementDomain(); |
| 248 return std::string(); | 257 return std::string(); |
| 249 } | 258 } |
| OLD | NEW |