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

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

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Work around STL android bug Created 6 years, 8 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_tests_unit.gypi ('k') | components/bookmarks.gypi » ('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 48898087d285caea56f51f547cb7f03f60199ea7..040d7c0cef2fe287b9367f187a4c70d2b1995576 100644
--- a/chrome/test/base/testing_profile.cc
+++ b/chrome/test/base/testing_profile.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
+#include "chrome/browser/bookmarks/chrome_bookmark_client.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
@@ -494,9 +495,16 @@ void TestingProfile::DestroyTopSites() {
static KeyedService* BuildBookmarkModel(content::BrowserContext* context) {
Profile* profile = static_cast<Profile*>(context);
- BookmarkModel* bookmark_model = new BookmarkModel(profile, false);
- bookmark_model->Load(profile->GetIOTaskRunner());
- return bookmark_model;
+ ChromeBookmarkClient* bookmark_client =
+ new ChromeBookmarkClient(profile, false);
+ bookmark_client->model()->Load(
+ profile->GetPrefs(),
+ profile->GetPrefs()->GetString(prefs::kAcceptLanguages),
+ profile->GetPath(),
+ profile->GetIOTaskRunner(),
+ content::BrowserThread::GetMessageLoopProxyForThread(
+ content::BrowserThread::UI));
+ return bookmark_client;
}
void TestingProfile::CreateBookmarkModel(bool delete_file) {
@@ -505,9 +513,10 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) {
base::DeleteFile(path, false);
}
// This will create a bookmark model.
- BookmarkModel* bookmark_service = static_cast<BookmarkModel*>(
- BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
- this, BuildBookmarkModel));
+ BookmarkModel* bookmark_service =
+ static_cast<ChromeBookmarkClient*>(
+ BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse(
+ this, BuildBookmarkModel))->model();
HistoryService* history_service =
HistoryServiceFactory::GetForProfileWithoutCreating(this);
« no previous file with comments | « chrome/chrome_tests_unit.gypi ('k') | components/bookmarks.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698