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

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

Issue 10821097: 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, 5 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
Index: chrome/browser/bookmarks/bookmark_extension_api.cc
===================================================================
--- chrome/browser/bookmarks/bookmark_extension_api.cc (revision 149452)
+++ chrome/browser/bookmarks/bookmark_extension_api.cc (working copy)
@@ -22,6 +22,7 @@
#include "chrome/browser/bookmarks/bookmark_extension_helpers.h"
#include "chrome/browser/bookmarks/bookmark_html_writer.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
+#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/extensions/event_router.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
@@ -83,7 +84,7 @@
} // namespace
void BookmarksFunction::Run() {
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
if (!model->IsLoaded()) {
// Bookmarks are not ready yet. We'll wait.
registrar_.Add(
@@ -127,7 +128,7 @@
if (!source_profile || !source_profile->IsSameProfile(profile()))
return;
- DCHECK(profile()->GetBookmarkModel()->IsLoaded());
+ DCHECK(BookmarkModelFactory::GetForProfile(profile())->IsLoaded());
Run();
Release(); // Balanced in Run().
}
@@ -463,7 +464,7 @@
if (name() == RemoveTreeBookmarkFunction::function_name())
recursive = true;
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
if (!bookmark_extension_helpers::RemoveNode(model, id, recursive, &error_))
return false;
@@ -563,7 +564,7 @@
return false;
}
- BookmarkModel* model = profile()->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
const BookmarkNode* node = model->GetNodeByID(id);
if (!node) {
error_ = keys::kNoNodeError;
@@ -712,7 +713,7 @@
if (!json->GetString(keys::kParentIdKey, &parent_id))
return;
}
- BookmarkModel* model = profile_->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_);
int64 parent_id_int64;
base::StringToInt64(parent_id, &parent_id_int64);
@@ -750,7 +751,7 @@
}
for (IdList::iterator it = ids.begin(); it != ids.end(); ++it) {
- BookmarkModel* model = profile_->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_);
const BookmarkNode* node = model->GetNodeByID(*it);
if (!node || node->is_root())
return;
« no previous file with comments | « chrome/browser/bookmarks/bookmark_expanded_state_tracker_unittest.cc ('k') | chrome/browser/bookmarks/bookmark_html_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698