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

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

Issue 946363002: Make ChromeBookmarkClient::CanSetPermanentNodeTitle say true for the supervised node. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 base::Passed(&managed), 189 base::Passed(&managed),
190 base::Passed(managed_bookmarks_tracker_->GetInitialManagedBookmarks()), 190 base::Passed(managed_bookmarks_tracker_->GetInitialManagedBookmarks()),
191 base::Passed(&supervised), 191 base::Passed(&supervised),
192 base::Passed( 192 base::Passed(
193 supervised_bookmarks_tracker_->GetInitialManagedBookmarks())); 193 supervised_bookmarks_tracker_->GetInitialManagedBookmarks()));
194 } 194 }
195 195
196 bool ChromeBookmarkClient::CanSetPermanentNodeTitle( 196 bool ChromeBookmarkClient::CanSetPermanentNodeTitle(
197 const BookmarkNode* permanent_node) { 197 const BookmarkNode* permanent_node) {
198 // The |managed_node_| can have its title updated if the user signs in or 198 // The |managed_node_| can have its title updated if the user signs in or
199 // out, since the name of the managed domain can appear in it. The 199 // out, since the name of the managed domain can appear in it.
200 // |supervised_node_| has a fixed title which can never be updated. 200 // Also, both |managed_node_| and |supervised_node_| can have their title
201 // updated on locale changes (crbug.com/459448).
201 return (!bookmarks::IsDescendantOf(permanent_node, managed_node_) && 202 return (!bookmarks::IsDescendantOf(permanent_node, managed_node_) &&
202 !bookmarks::IsDescendantOf(permanent_node, supervised_node_)) || 203 !bookmarks::IsDescendantOf(permanent_node, supervised_node_)) ||
203 permanent_node == managed_node_; 204 permanent_node == managed_node_ ||
205 permanent_node == supervised_node_;
204 } 206 }
205 207
206 bool ChromeBookmarkClient::CanSyncNode(const BookmarkNode* node) { 208 bool ChromeBookmarkClient::CanSyncNode(const BookmarkNode* node) {
207 return !bookmarks::IsDescendantOf(node, managed_node_) && 209 return !bookmarks::IsDescendantOf(node, managed_node_) &&
208 !bookmarks::IsDescendantOf(node, supervised_node_); 210 !bookmarks::IsDescendantOf(node, supervised_node_);
209 } 211 }
210 212
211 bool ChromeBookmarkClient::CanBeEditedByUser(const BookmarkNode* node) { 213 bool ChromeBookmarkClient::CanBeEditedByUser(const BookmarkNode* node) {
212 return !bookmarks::IsDescendantOf(node, managed_node_) && 214 return !bookmarks::IsDescendantOf(node, managed_node_) &&
213 !bookmarks::IsDescendantOf(node, supervised_node_); 215 !bookmarks::IsDescendantOf(node, supervised_node_);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 return extra_nodes.Pass(); 276 return extra_nodes.Pass();
275 } 277 }
276 278
277 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { 279 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() {
278 policy::ProfilePolicyConnector* connector = 280 policy::ProfilePolicyConnector* connector =
279 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile_); 281 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile_);
280 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) 282 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks))
281 return connector->GetManagementDomain(); 283 return connector->GetManagementDomain();
282 return std::string(); 284 return std::string();
283 } 285 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698