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

Side by Side Diff: chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc

Issue 769153007: Managed bookmarks for supervised users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build (Android & unit_tests) 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
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/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h" 5 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 void BookmarkManagerPrivateDragEventRouter::ClearBookmarkNodeData() { 354 void BookmarkManagerPrivateDragEventRouter::ClearBookmarkNodeData() {
355 bookmark_drag_data_.Clear(); 355 bookmark_drag_data_.Clear();
356 } 356 }
357 357
358 bool ClipboardBookmarkManagerFunction::CopyOrCut(bool cut, 358 bool ClipboardBookmarkManagerFunction::CopyOrCut(bool cut,
359 const std::vector<std::string>& id_list) { 359 const std::vector<std::string>& id_list) {
360 BookmarkModel* model = GetBookmarkModel(); 360 BookmarkModel* model = GetBookmarkModel();
361 ChromeBookmarkClient* client = GetChromeBookmarkClient(); 361 ChromeBookmarkClient* client = GetChromeBookmarkClient();
362 std::vector<const BookmarkNode*> nodes; 362 std::vector<const BookmarkNode*> nodes;
363 EXTENSION_FUNCTION_VALIDATE(GetNodesFromVector(model, id_list, &nodes)); 363 EXTENSION_FUNCTION_VALIDATE(GetNodesFromVector(model, id_list, &nodes));
364 if (cut && client->HasDescendantsOfManagedNode(nodes)) { 364 if (cut && bookmarks::HasDescendantsOf(nodes, client->managed_node())) {
365 error_ = bookmark_keys::kModifyManagedError; 365 error_ = bookmark_keys::kModifyManagedError;
366 return false; 366 return false;
367 } 367 }
368 bookmarks::CopyToClipboard(model, nodes, cut); 368 bookmarks::CopyToClipboard(model, nodes, cut);
369 return true; 369 return true;
370 } 370 }
371 371
372 bool BookmarkManagerPrivateCopyFunction::RunOnReady() { 372 bool BookmarkManagerPrivateCopyFunction::RunOnReady() {
373 scoped_ptr<Copy::Params> params(Copy::Params::Create(*args_)); 373 scoped_ptr<Copy::Params> params(Copy::Params::Create(*args_));
374 EXTENSION_FUNCTION_VALIDATE(params); 374 EXTENSION_FUNCTION_VALIDATE(params);
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 835
836 enhanced_bookmarks::EnhancedBookmarkModel* model = 836 enhanced_bookmarks::EnhancedBookmarkModel* model =
837 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetForBrowserContext( 837 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetForBrowserContext(
838 browser_context()); 838 browser_context());
839 model->SetVersionSuffix(params->version); 839 model->SetVersionSuffix(params->version);
840 840
841 return true; 841 return true;
842 } 842 }
843 843
844 } // namespace extensions 844 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698