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

Side by Side Diff: components/bookmarks/test/test_bookmark_client.cc

Issue 312093007: Revert of Added BookmarkClient::CanBeEditedByUser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « components/bookmarks/test/test_bookmark_client.h ('k') | 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 "components/bookmarks/test/test_bookmark_client.h" 5 #include "components/bookmarks/test/test_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 "components/bookmarks/browser/bookmark_model.h" 10 #include "components/bookmarks/browser/bookmark_model.h"
11 #include "components/bookmarks/browser/bookmark_node.h" 11 #include "components/bookmarks/browser/bookmark_node.h"
12 #include "components/bookmarks/browser/bookmark_storage.h" 12 #include "components/bookmarks/browser/bookmark_storage.h"
13 13
14 namespace test { 14 namespace test {
15 15
16 TestBookmarkClient::TestBookmarkClient() {} 16 TestBookmarkClient::TestBookmarkClient() {}
17 17
18 TestBookmarkClient::~TestBookmarkClient() {} 18 TestBookmarkClient::~TestBookmarkClient() {}
19 19
20 scoped_ptr<BookmarkModel> TestBookmarkClient::CreateModel(bool index_urls) { 20 scoped_ptr<BookmarkModel> TestBookmarkClient::CreateModel(bool index_urls) {
21 scoped_ptr<BookmarkModel> bookmark_model(new BookmarkModel(this, index_urls)); 21 scoped_ptr<BookmarkModel> bookmark_model(new BookmarkModel(this, index_urls));
22 scoped_ptr<bookmarks::BookmarkLoadDetails> details = 22 bookmark_model->DoneLoading(bookmark_model->CreateLoadDetails(std::string()));
23 bookmark_model->CreateLoadDetails(std::string());
24 details->LoadExtraNodes();
25 bookmark_model->DoneLoading(details.Pass());
26 return bookmark_model.Pass(); 23 return bookmark_model.Pass();
27 } 24 }
28 25
29 void TestBookmarkClient::SetExtraNodesToLoad( 26 void TestBookmarkClient::SetExtraNodesToLoad(
30 bookmarks::BookmarkPermanentNodeList extra_nodes) { 27 bookmarks::BookmarkPermanentNodeList extra_nodes) {
31 extra_nodes_to_load_ = extra_nodes.Pass(); 28 extra_nodes_to_load_ = extra_nodes.Pass();
32 // Keep a copy in |extra_nodes_| for the acessor. 29 // Keep a copy in |extra_nodes_| for the acessor.
33 extra_nodes_ = extra_nodes_to_load_.get(); 30 extra_nodes_ = extra_nodes_to_load_.get();
34 } 31 }
35 32
(...skipping 25 matching lines...) Expand all
61 } 58 }
62 59
63 void TestBookmarkClient::RecordAction(const base::UserMetricsAction& action) { 60 void TestBookmarkClient::RecordAction(const base::UserMetricsAction& action) {
64 } 61 }
65 62
66 bookmarks::LoadExtraCallback TestBookmarkClient::GetLoadExtraNodesCallback() { 63 bookmarks::LoadExtraCallback TestBookmarkClient::GetLoadExtraNodesCallback() {
67 return base::Bind(&TestBookmarkClient::LoadExtraNodes, 64 return base::Bind(&TestBookmarkClient::LoadExtraNodes,
68 base::Passed(&extra_nodes_to_load_)); 65 base::Passed(&extra_nodes_to_load_));
69 } 66 }
70 67
68 bool TestBookmarkClient::CanRemovePermanentNodeChildren(
69 const BookmarkNode* node) {
70 return !IsAnExtraNode(node);
71 }
72
71 bool TestBookmarkClient::CanSetPermanentNodeTitle( 73 bool TestBookmarkClient::CanSetPermanentNodeTitle(
72 const BookmarkNode* permanent_node) { 74 const BookmarkNode* permanent_node) {
73 return IsExtraNodeRoot(permanent_node); 75 return IsExtraNodeRoot(permanent_node);
74 } 76 }
75 77
76 bool TestBookmarkClient::CanSyncNode(const BookmarkNode* node) { 78 bool TestBookmarkClient::CanSyncNode(const BookmarkNode* node) {
77 return !IsAnExtraNode(node); 79 return !IsAnExtraNode(node);
78 } 80 }
79 81
80 bool TestBookmarkClient::CanBeEditedByUser(const BookmarkNode* node) { 82 bool TestBookmarkClient::CanReorderChildren(const BookmarkNode* parent) {
81 return !IsAnExtraNode(node); 83 return !IsAnExtraNode(parent);
82 } 84 }
83 85
84 // static 86 // static
85 bookmarks::BookmarkPermanentNodeList TestBookmarkClient::LoadExtraNodes( 87 bookmarks::BookmarkPermanentNodeList TestBookmarkClient::LoadExtraNodes(
86 bookmarks::BookmarkPermanentNodeList extra_nodes, 88 bookmarks::BookmarkPermanentNodeList extra_nodes,
87 int64* next_id) { 89 int64* next_id) {
88 return extra_nodes.Pass(); 90 return extra_nodes.Pass();
89 } 91 }
90 92
91 } // namespace test 93 } // namespace test
OLDNEW
« no previous file with comments | « components/bookmarks/test/test_bookmark_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698