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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 10827047: 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/ui/views/bookmarks/bookmark_bubble_view.cc
===================================================================
--- chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc (revision 148477)
+++ chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc (working copy)
@@ -10,6 +10,7 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/bookmarks/bookmark_editor.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/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
@@ -110,7 +111,7 @@
if (apply_edits_) {
ApplyEdits();
} else if (remove_bookmark_) {
- BookmarkModel* model = profile_->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_);
const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_);
if (node)
model->Remove(node->parent(), node->parent()->GetIndexOf(node));
@@ -252,8 +253,9 @@
url_(url),
newly_bookmarked_(newly_bookmarked),
parent_model_(
- profile_->GetBookmarkModel(),
- profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url)),
+ BookmarkModelFactory::GetForProfile(profile_),
+ BookmarkModelFactory::GetForProfile(profile_)->
+ GetMostRecentlyAddedNodeForURL(url)),
remove_link_(NULL),
edit_button_(NULL),
close_button_(NULL),
@@ -264,7 +266,8 @@
}
string16 BookmarkBubbleView::GetTitle() {
- BookmarkModel* bookmark_model= profile_->GetBookmarkModel();
+ BookmarkModel* bookmark_model =
+ BookmarkModelFactory::GetForProfile(profile_);
const BookmarkNode* node =
bookmark_model->GetMostRecentlyAddedNodeForURL(url_);
if (node)
@@ -307,8 +310,8 @@
}
void BookmarkBubbleView::ShowEditor() {
- const BookmarkNode* node =
- profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_);
+ const BookmarkNode* node = BookmarkModelFactory::GetForProfile(
+ profile_)->GetMostRecentlyAddedNodeForURL(url_);
views::Widget* parent = anchor_widget();
DCHECK(parent);
@@ -326,7 +329,7 @@
// Set this to make sure we don't attempt to apply edits again.
apply_edits_ = false;
- BookmarkModel* model = profile_->GetBookmarkModel();
+ BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_);
const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_);
if (node) {
const string16 new_title = title_tf_->text();

Powered by Google App Engine
This is Rietveld 408576698