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

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

Issue 302433010: Pass an instance of FaviconClient to FaviconService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@latest2
Patch Set: Added include. Created 6 years, 5 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/history/android/sqlite_cursor_unittest.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 "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/prefs/testing_pref_store.h" 12 #include "base/prefs/testing_pref_store.h"
13 #include "base/run_loop.h" 13 #include "base/run_loop.h"
14 #include "base/strings/string_number_conversions.h" 14 #include "base/strings/string_number_conversions.h"
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
16 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 16 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
17 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 17 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
18 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h" 18 #include "chrome/browser/bookmarks/chrome_bookmark_client_factory.h"
19 #include "chrome/browser/browser_process.h" 19 #include "chrome/browser/browser_process.h"
20 #include "chrome/browser/chrome_notification_types.h" 20 #include "chrome/browser/chrome_notification_types.h"
21 #include "chrome/browser/content_settings/host_content_settings_map.h" 21 #include "chrome/browser/content_settings/host_content_settings_map.h"
22 #include "chrome/browser/extensions/extension_special_storage_policy.h" 22 #include "chrome/browser/extensions/extension_special_storage_policy.h"
23 #include "chrome/browser/extensions/extension_system_factory.h" 23 #include "chrome/browser/extensions/extension_system_factory.h"
24 #include "chrome/browser/extensions/test_extension_system.h" 24 #include "chrome/browser/extensions/test_extension_system.h"
25 #include "chrome/browser/favicon/chrome_favicon_client_factory.h"
25 #include "chrome/browser/favicon/favicon_service.h" 26 #include "chrome/browser/favicon/favicon_service.h"
26 #include "chrome/browser/favicon/favicon_service_factory.h" 27 #include "chrome/browser/favicon/favicon_service_factory.h"
27 #include "chrome/browser/history/chrome_history_client.h" 28 #include "chrome/browser/history/chrome_history_client.h"
28 #include "chrome/browser/history/chrome_history_client_factory.h" 29 #include "chrome/browser/history/chrome_history_client_factory.h"
29 #include "chrome/browser/history/history_backend.h" 30 #include "chrome/browser/history/history_backend.h"
30 #include "chrome/browser/history/history_db_task.h" 31 #include "chrome/browser/history/history_db_task.h"
31 #include "chrome/browser/history/history_service.h" 32 #include "chrome/browser/history/history_service.h"
32 #include "chrome/browser/history/history_service_factory.h" 33 #include "chrome/browser/history/history_service_factory.h"
33 #include "chrome/browser/history/top_sites.h" 34 #include "chrome/browser/history/top_sites.h"
34 #include "chrome/browser/history/web_history_service_factory.h" 35 #include "chrome/browser/history/web_history_service_factory.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 // failure. 420 // failure.
420 if (resource_context_) { 421 if (resource_context_) {
421 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE, 422 CHECK(BrowserThread::DeleteSoon(BrowserThread::IO, FROM_HERE,
422 resource_context_)); 423 resource_context_));
423 resource_context_ = NULL; 424 resource_context_ = NULL;
424 content::RunAllPendingInMessageLoop(BrowserThread::IO); 425 content::RunAllPendingInMessageLoop(BrowserThread::IO);
425 } 426 }
426 } 427 }
427 428
428 static KeyedService* BuildFaviconService(content::BrowserContext* profile) { 429 static KeyedService* BuildFaviconService(content::BrowserContext* profile) {
429 return new FaviconService(static_cast<Profile*>(profile)); 430 FaviconClient* favicon_client =
431 ChromeFaviconClientFactory::GetForProfile(static_cast<Profile*>(profile));
432 return new FaviconService(static_cast<Profile*>(profile), favicon_client);
430 } 433 }
431 434
432 void TestingProfile::CreateFaviconService() { 435 void TestingProfile::CreateFaviconService() {
433 // It is up to the caller to create the history service if one is needed. 436 // It is up to the caller to create the history service if one is needed.
434 FaviconServiceFactory::GetInstance()->SetTestingFactory( 437 FaviconServiceFactory::GetInstance()->SetTestingFactory(
435 this, BuildFaviconService); 438 this, BuildFaviconService);
436 } 439 }
437 440
438 static KeyedService* BuildHistoryService(content::BrowserContext* context) { 441 static KeyedService* BuildHistoryService(content::BrowserContext* context) {
439 Profile* profile = static_cast<Profile*>(context); 442 Profile* profile = static_cast<Profile*>(context);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
951 path_, 954 path_,
952 delegate_, 955 delegate_,
953 extension_policy_, 956 extension_policy_,
954 pref_service_.Pass(), 957 pref_service_.Pass(),
955 incognito_, 958 incognito_,
956 guest_session_, 959 guest_session_,
957 supervised_user_id_, 960 supervised_user_id_,
958 policy_service_.Pass(), 961 policy_service_.Pass(),
959 testing_factories_)); 962 testing_factories_));
960 } 963 }
OLDNEW
« no previous file with comments | « chrome/browser/history/android/sqlite_cursor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698