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

Unified Diff: chrome/browser/bookmarks/bookmark_extension_api.cc

Issue 10827161: Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/bookmarks_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/bookmarks/bookmark_extension_api.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_extension_api.cc (revision 149630)
+++ chrome/browser/bookmarks/bookmark_extension_api.cc (working copy)
@@ -297,7 +297,7 @@
EXTENSION_FUNCTION_VALIDATE(params.get());
std::vector<linked_ptr<BookmarkTreeNode> > nodes;
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
if (params->id_or_id_list_type ==
bookmarks::Get::Params::ID_OR_ID_LIST_ARRAY) {
std::vector<std::string>* ids = params->id_or_id_list_array.get();
@@ -341,7 +341,8 @@
return false;
std::vector<linked_ptr<BookmarkTreeNode> > nodes;
- const BookmarkNode* node = profile()->GetBookmarkModel()->GetNodeByID(id);
+ const BookmarkNode* node =
+ BookmarkModelFactory::GetForProfile(profile())->GetNodeByID(id);
if (!node) {
error_ = keys::kNoNodeError;
return false;
@@ -364,9 +365,10 @@
return false;
std::vector<const BookmarkNode*> nodes;
- bookmark_utils::GetMostRecentlyAddedEntries(profile()->GetBookmarkModel(),
- params->number_of_items,
- &nodes);
+ bookmark_utils::GetMostRecentlyAddedEntries(
+ BookmarkModelFactory::GetForProfile(profile()),
+ params->number_of_items,
+ &nodes);
std::vector<linked_ptr<BookmarkTreeNode> > tree_nodes;
std::vector<const BookmarkNode*>::iterator i = nodes.begin();
@@ -381,7 +383,8 @@
bool GetBookmarkTreeFunction::RunImpl() {
std::vector<linked_ptr<BookmarkTreeNode> > nodes;
- const BookmarkNode* node = profile()->GetBookmarkModel()->root_node();
+ const BookmarkNode* node =
+ BookmarkModelFactory::GetForProfile(profile())->root_node();
bookmark_extension_helpers::AddNode(node, &nodes, true);
results_ = bookmarks::GetTree::Results::Create(nodes);
return true;
@@ -396,7 +399,8 @@
if (!GetBookmarkIdAsInt64(params->id, &id))
return false;
- const BookmarkNode* node = profile()->GetBookmarkModel()->GetNodeByID(id);
+ const BookmarkNode* node =
+ BookmarkModelFactory::GetForProfile(profile())->GetNodeByID(id);
if (!node) {
error_ = keys::kNoNodeError;
return false;
@@ -415,11 +419,12 @@
std::string lang = profile()->GetPrefs()->GetString(prefs::kAcceptLanguages);
std::vector<const BookmarkNode*> nodes;
- bookmark_utils::GetBookmarksContainingText(profile()->GetBookmarkModel(),
- UTF8ToUTF16(params->query),
- std::numeric_limits<int>::max(),
- lang,
- &nodes);
+ bookmark_utils::GetBookmarksContainingText(
+ BookmarkModelFactory::GetForProfile(profile()),
+ UTF8ToUTF16(params->query),
+ std::numeric_limits<int>::max(),
+ lang,
+ &nodes);
std::vector<linked_ptr<BookmarkTreeNode> > tree_nodes;
for (std::vector<const BookmarkNode*>::iterator node_iter = nodes.begin();
@@ -479,7 +484,7 @@
bookmarks::Create::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
int64 parentId;
if (!params->bookmark.parent_id.get()) {
@@ -638,7 +643,7 @@
return false;
}
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
// Optional but we need to distinguish non present from an empty title.
string16 title;
« no previous file with comments | « no previous file | chrome/browser/sync/test/integration/bookmarks_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698