Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/base/testing_profile.h" | 5 #include "chrome/test/base/testing_profile.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 107 #include "extensions/browser/event_router_factory.h" | 107 #include "extensions/browser/event_router_factory.h" |
| 108 #include "extensions/browser/extension_pref_value_map.h" | 108 #include "extensions/browser/extension_pref_value_map.h" |
| 109 #include "extensions/browser/extension_pref_value_map_factory.h" | 109 #include "extensions/browser/extension_pref_value_map_factory.h" |
| 110 #include "extensions/browser/extension_prefs.h" | 110 #include "extensions/browser/extension_prefs.h" |
| 111 #include "extensions/browser/extension_prefs_factory.h" | 111 #include "extensions/browser/extension_prefs_factory.h" |
| 112 #include "extensions/browser/extension_prefs_observer.h" | 112 #include "extensions/browser/extension_prefs_observer.h" |
| 113 #include "extensions/browser/extension_system.h" | 113 #include "extensions/browser/extension_system.h" |
| 114 #endif | 114 #endif |
| 115 | 115 |
| 116 #if defined(OS_ANDROID) | 116 #if defined(OS_ANDROID) |
| 117 #include "chrome/browser/android/offline_pages/offline_page_bookmark_observer.h" | |
| 117 #include "chrome/browser/signin/oauth2_token_service_delegate_android.h" | 118 #include "chrome/browser/signin/oauth2_token_service_delegate_android.h" |
| 118 #endif | 119 #endif |
| 119 | 120 |
| 120 #if defined(ENABLE_SUPERVISED_USERS) | 121 #if defined(ENABLE_SUPERVISED_USERS) |
| 121 #include "chrome/browser/supervised_user/supervised_user_constants.h" | 122 #include "chrome/browser/supervised_user/supervised_user_constants.h" |
| 122 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" | 123 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
| 123 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" | 124 #include "chrome/browser/supervised_user/supervised_user_settings_service.h" |
| 124 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" | 125 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" |
| 125 #endif | 126 #endif |
| 126 | 127 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 210 TemplateURLServiceFactory::GetForProfile(profile), | 211 TemplateURLServiceFactory::GetForProfile(profile), |
| 211 content::BrowserThread::GetBlockingPool(), | 212 content::BrowserThread::GetBlockingPool(), |
| 212 profile->GetPath(), SchemeSet())); | 213 profile->GetPath(), SchemeSet())); |
| 213 in_memory_url_index->Init(); | 214 in_memory_url_index->Init(); |
| 214 return std::move(in_memory_url_index); | 215 return std::move(in_memory_url_index); |
| 215 } | 216 } |
| 216 | 217 |
| 217 std::unique_ptr<KeyedService> BuildBookmarkModel( | 218 std::unique_ptr<KeyedService> BuildBookmarkModel( |
| 218 content::BrowserContext* context) { | 219 content::BrowserContext* context) { |
| 219 Profile* profile = Profile::FromBrowserContext(context); | 220 Profile* profile = Profile::FromBrowserContext(context); |
| 220 std::unique_ptr<BookmarkModel> bookmark_model( | 221 std::unique_ptr<bookmarks::BookmarkModelObserver> offline_page_observer = |
| 221 new BookmarkModel(base::WrapUnique(new ChromeBookmarkClient( | 222 nullptr; |
| 222 profile, ManagedBookmarkServiceFactory::GetForProfile(profile))))); | 223 #if defined(OS_ANDROID) |
| 224 offline_page_observer = | |
| 225 base::MakeUnique<offline_pages::OfflinePageBookmarkObserver>(profile); | |
| 226 #endif | |
| 227 std::unique_ptr<BookmarkModel> bookmark_model(new BookmarkModel( | |
| 228 base::WrapUnique(new ChromeBookmarkClient( | |
|
Dmitry Titov
2016/08/26 23:08:59
Since you touch this code, the style guide now say
romax
2016/08/29 22:58:02
Done.
| |
| 229 profile, ManagedBookmarkServiceFactory::GetForProfile(profile))), | |
| 230 std::move(offline_page_observer))); | |
| 223 bookmark_model->Load(profile->GetPrefs(), profile->GetPath(), | 231 bookmark_model->Load(profile->GetPrefs(), profile->GetPath(), |
| 224 profile->GetIOTaskRunner(), | 232 profile->GetIOTaskRunner(), |
| 225 content::BrowserThread::GetTaskRunnerForThread( | 233 content::BrowserThread::GetTaskRunnerForThread( |
| 226 content::BrowserThread::UI)); | 234 content::BrowserThread::UI)); |
| 227 return std::move(bookmark_model); | 235 return std::move(bookmark_model); |
| 228 } | 236 } |
| 229 | 237 |
| 230 void TestProfileErrorCallback(WebDataServiceWrapper::ErrorType error_type, | 238 void TestProfileErrorCallback(WebDataServiceWrapper::ErrorType error_type, |
| 231 sql::InitStatus status, | 239 sql::InitStatus status, |
| 232 const std::string& diagnostics) { | 240 const std::string& diagnostics) { |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1069 // Note: Owned by |original_profile|. | 1077 // Note: Owned by |original_profile|. |
| 1070 return new TestingProfile(path_, delegate_, | 1078 return new TestingProfile(path_, delegate_, |
| 1071 #if defined(ENABLE_EXTENSIONS) | 1079 #if defined(ENABLE_EXTENSIONS) |
| 1072 extension_policy_, | 1080 extension_policy_, |
| 1073 #endif | 1081 #endif |
| 1074 std::move(pref_service_), original_profile, | 1082 std::move(pref_service_), original_profile, |
| 1075 guest_session_, supervised_user_id_, | 1083 guest_session_, supervised_user_id_, |
| 1076 std::move(policy_service_), testing_factories_, | 1084 std::move(policy_service_), testing_factories_, |
| 1077 profile_name_); | 1085 profile_name_); |
| 1078 } | 1086 } |
| OLD | NEW |