Commit b39a8db3 authored by rlp@chromium.org's avatar rlp@chromium.org

Removing instances of profile_->GetBookmarkModel() as part of converting BookmarkModel to a PKS.

BUG=112525
TEST=unittests, manual 

Review URL: https://chromiumcodereview.appspot.com/10823050

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148830 0039d316-1c4b-4281-b951-d872f2087c98
parent 44dee133
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_applescript_utils_unittest.h"
#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
@implementation FakeAppDelegate @implementation FakeAppDelegate
...@@ -69,5 +70,5 @@ void BookmarkAppleScriptTest::SetUp() { ...@@ -69,5 +70,5 @@ void BookmarkAppleScriptTest::SetUp() {
} }
BookmarkModel& BookmarkAppleScriptTest::model() { BookmarkModel& BookmarkAppleScriptTest::model() {
return *profile()->GetBookmarkModel(); return *BookmarkModelFactory::GetForProfile(profile());
} }
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "base/sys_string_conversions.h" #include "base/sys_string_conversions.h"
#import "chrome/browser/app_controller_mac.h" #import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#import "chrome/browser/chrome_browser_application_mac.h" #import "chrome/browser/chrome_browser_application_mac.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h" #import "chrome/browser/ui/cocoa/applescript/bookmark_item_applescript.h"
...@@ -118,7 +119,7 @@ ...@@ -118,7 +119,7 @@
return NULL; return NULL;
} }
BookmarkModel* model = lastProfile->GetBookmarkModel(); BookmarkModel* model = BookmarkModelFactory::GetForProfile(lastProfile);
if (!model->IsLoaded()) { if (!model->IsLoaded()) {
AppleScript::SetError(AppleScript::errBookmarkModelLoad); AppleScript::SetError(AppleScript::errBookmarkModelLoad);
return NULL; return NULL;
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "base/sys_string_conversions.h" #include "base/sys_string_conversions.h"
#include "chrome/app/chrome_command_ids.h" // IDC_* #include "chrome/app/chrome_command_ids.h" // IDC_*
#include "chrome/browser/bookmarks/bookmark_editor.h" #include "chrome/browser/bookmarks/bookmark_editor.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/instant/instant_controller.h" #include "chrome/browser/instant/instant_controller.h"
#include "chrome/browser/managed_mode.h" #include "chrome/browser/managed_mode.h"
...@@ -1603,7 +1604,8 @@ enum { ...@@ -1603,7 +1604,8 @@ enum {
- (void)showBookmarkBubbleForURL:(const GURL&)url - (void)showBookmarkBubbleForURL:(const GURL&)url
alreadyBookmarked:(BOOL)alreadyMarked { alreadyBookmarked:(BOOL)alreadyMarked {
if (!bookmarkBubbleController_) { if (!bookmarkBubbleController_) {
BookmarkModel* model = browser_->profile()->GetBookmarkModel(); BookmarkModel* model =
BookmarkModelFactory::GetForProfile(browser_->profile());
const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url); const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url);
bookmarkBubbleController_ = bookmarkBubbleController_ =
[[BookmarkBubbleController alloc] initWithParentWindow:[self window] [[BookmarkBubbleController alloc] initWithParentWindow:[self window]
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/utf_string_conversions.h" #include "base/utf_string_conversions.h"
#include "chrome/browser/bookmarks/bookmark_model.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/bookmarks/bookmark_utils.h"
#include "chrome/browser/download/download_shelf.h" #include "chrome/browser/download/download_shelf.h"
#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/pref_service.h"
...@@ -55,7 +56,8 @@ class ViewIDTest : public InProcessBrowserTest { ...@@ -55,7 +56,8 @@ class ViewIDTest : public InProcessBrowserTest {
browser()->window()->GetDownloadShelf()->Show(); browser()->window()->GetDownloadShelf()->Show();
// Create a bookmark to test VIEW_ID_BOOKMARK_BAR_ELEMENT // Create a bookmark to test VIEW_ID_BOOKMARK_BAR_ELEMENT
BookmarkModel* bookmark_model = browser()->profile()->GetBookmarkModel(); BookmarkModel* bookmark_model =
BookmarkModelFactory::GetForProfile(browser()->profile());
if (bookmark_model) { if (bookmark_model) {
if (!bookmark_model->IsLoaded()) if (!bookmark_model->IsLoaded())
ui_test_utils::WaitForBookmarkModelToLoad(bookmark_model); ui_test_utils::WaitForBookmarkModelToLoad(bookmark_model);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment