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

Side by Side Diff: chrome/test/base/testing_profile.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 protected: 188 protected:
189 ~TestExtensionURLRequestContextGetter() override {} 189 ~TestExtensionURLRequestContextGetter() override {}
190 190
191 private: 191 private:
192 std::unique_ptr<net::URLRequestContext> context_; 192 std::unique_ptr<net::URLRequestContext> context_;
193 }; 193 };
194 194
195 std::unique_ptr<KeyedService> BuildHistoryService( 195 std::unique_ptr<KeyedService> BuildHistoryService(
196 content::BrowserContext* context) { 196 content::BrowserContext* context) {
197 Profile* profile = Profile::FromBrowserContext(context);
198 return base::WrapUnique(new history::HistoryService( 197 return base::WrapUnique(new history::HistoryService(
199 base::WrapUnique(new ChromeHistoryClient( 198 base::WrapUnique(new ChromeHistoryClient(
200 BookmarkModelFactory::GetForProfile(profile))), 199 BookmarkModelFactory::GetForBrowserContext(context))),
201 base::WrapUnique(new history::ContentVisitDelegate(profile)))); 200 base::WrapUnique(new history::ContentVisitDelegate(context))));
202 } 201 }
203 202
204 std::unique_ptr<KeyedService> BuildInMemoryURLIndex( 203 std::unique_ptr<KeyedService> BuildInMemoryURLIndex(
205 content::BrowserContext* context) { 204 content::BrowserContext* context) {
206 Profile* profile = Profile::FromBrowserContext(context); 205 Profile* profile = Profile::FromBrowserContext(context);
207 std::unique_ptr<InMemoryURLIndex> in_memory_url_index( 206 std::unique_ptr<InMemoryURLIndex> in_memory_url_index(
208 new InMemoryURLIndex(BookmarkModelFactory::GetForProfile(profile), 207 new InMemoryURLIndex(BookmarkModelFactory::GetForBrowserContext(profile),
209 HistoryServiceFactory::GetForProfile( 208 HistoryServiceFactory::GetForProfile(
210 profile, ServiceAccessType::IMPLICIT_ACCESS), 209 profile, ServiceAccessType::IMPLICIT_ACCESS),
211 TemplateURLServiceFactory::GetForProfile(profile), 210 TemplateURLServiceFactory::GetForProfile(profile),
212 content::BrowserThread::GetBlockingPool(), 211 content::BrowserThread::GetBlockingPool(),
213 profile->GetPath(), SchemeSet())); 212 profile->GetPath(), SchemeSet()));
214 in_memory_url_index->Init(); 213 in_memory_url_index->Init();
215 return std::move(in_memory_url_index); 214 return std::move(in_memory_url_index);
216 } 215 }
217 216
218 std::unique_ptr<KeyedService> BuildBookmarkModel( 217 std::unique_ptr<KeyedService> BuildBookmarkModel(
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1069 // Note: Owned by |original_profile|. 1068 // Note: Owned by |original_profile|.
1070 return new TestingProfile(path_, delegate_, 1069 return new TestingProfile(path_, delegate_,
1071 #if defined(ENABLE_EXTENSIONS) 1070 #if defined(ENABLE_EXTENSIONS)
1072 extension_policy_, 1071 extension_policy_,
1073 #endif 1072 #endif
1074 std::move(pref_service_), original_profile, 1073 std::move(pref_service_), original_profile,
1075 guest_session_, supervised_user_id_, 1074 guest_session_, supervised_user_id_,
1076 std::move(policy_service_), testing_factories_, 1075 std::move(policy_service_), testing_factories_,
1077 profile_name_); 1076 profile_name_);
1078 } 1077 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/omnibox/omnibox_page_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698