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

Unified Diff: chrome/test/base/testing_profile.cc

Issue 1198963014: Change ownership of BookmarkClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_managed_and_supervised_nodes
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | components/bookmarks/browser/bookmark_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/testing_profile.cc
diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc
index 76f5101319c617c1465d23675b515d53cab3956b..16068beb65bfb7a68ab1667f5e7ed73c1164098b 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -18,7 +18,6 @@
#include "chrome/browser/autocomplete/in_memory_url_index_factory.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
-#include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/chrome_fallback_icon_client_factory.h"
@@ -210,11 +209,9 @@ scoped_ptr<KeyedService> BuildInMemoryURLIndex(
}
scoped_ptr<KeyedService> BuildBookmarkModel(content::BrowserContext* context) {
- Profile* profile = static_cast<Profile*>(context);
- ChromeBookmarkClient* bookmark_client =
- ChromeBookmarkClientFactory::GetForProfile(profile);
- scoped_ptr<BookmarkModel> bookmark_model(new BookmarkModel(bookmark_client));
- bookmark_client->Init(bookmark_model.get());
+ Profile* profile = Profile::FromBrowserContext(context);
+ scoped_ptr<BookmarkModel> bookmark_model(
+ new BookmarkModel(make_scoped_ptr(new ChromeBookmarkClient(profile))));
bookmark_model->Load(profile->GetPrefs(),
profile->GetPrefs()->GetString(prefs::kAcceptLanguages),
profile->GetPath(),
@@ -224,12 +221,6 @@ scoped_ptr<KeyedService> BuildBookmarkModel(content::BrowserContext* context) {
return bookmark_model.Pass();
}
-scoped_ptr<KeyedService> BuildChromeBookmarkClient(
- content::BrowserContext* context) {
- return make_scoped_ptr(
- new ChromeBookmarkClient(static_cast<Profile*>(context)));
-}
-
void TestProfileErrorCallback(WebDataServiceWrapper::ErrorType error_type,
sql::InitStatus status) {
NOTREACHED();
@@ -592,8 +583,6 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) {
base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName);
base::DeleteFile(path, false);
}
- ChromeBookmarkClientFactory::GetInstance()->SetTestingFactory(
- this, BuildChromeBookmarkClient);
// This creates the BookmarkModel.
ignore_result(BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
this, BuildBookmarkModel));
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | components/bookmarks/browser/bookmark_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698