diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 18:09:02 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-26 18:09:02 +0000 |
commit | c7fa4367503441fefc7da332b0bddd329ceea9dd (patch) | |
tree | b1469aab9cb635f9f00096b7f746047272474690 | |
parent | aca70615b08a5d741e5a10b91c8746e74d66f897 (diff) | |
download | chromium_src-c7fa4367503441fefc7da332b0bddd329ceea9dd.zip chromium_src-c7fa4367503441fefc7da332b0bddd329ceea9dd.tar.gz chromium_src-c7fa4367503441fefc7da332b0bddd329ceea9dd.tar.bz2 |
[components] Switch {RefCounted}ProfileKeyedService to use BrowserContext
instead of Profile. This will help move it out of chrome.
BUG=227219
Review URL: https://codereview.chromium.org/14141006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196777 0039d316-1c4b-4281-b951-d872f2087c98
223 files changed, 593 insertions, 427 deletions
diff --git a/apps/app_restore_service_factory.cc b/apps/app_restore_service_factory.cc index 22ebe32..71dd80b 100644 --- a/apps/app_restore_service_factory.cc +++ b/apps/app_restore_service_factory.cc @@ -5,6 +5,7 @@ #include "apps/app_restore_service_factory.h" #include "apps/app_restore_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace apps { @@ -35,8 +36,8 @@ AppRestoreServiceFactory::~AppRestoreServiceFactory() { } ProfileKeyedService* AppRestoreServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new AppRestoreService(profile); + content::BrowserContext* profile) const { + return new AppRestoreService(static_cast<Profile*>(profile)); } bool AppRestoreServiceFactory::ServiceIsCreatedWithProfile() const { diff --git a/apps/app_restore_service_factory.h b/apps/app_restore_service_factory.h index c17e845..b84c585 100644 --- a/apps/app_restore_service_factory.h +++ b/apps/app_restore_service_factory.h @@ -33,7 +33,7 @@ class AppRestoreServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; }; diff --git a/apps/shortcut_manager_factory.cc b/apps/shortcut_manager_factory.cc index 201c58a..b76b16d 100644 --- a/apps/shortcut_manager_factory.cc +++ b/apps/shortcut_manager_factory.cc @@ -5,6 +5,7 @@ #include "apps/shortcut_manager_factory.h" #include "apps/shortcut_manager.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace apps { @@ -35,8 +36,8 @@ ShortcutManagerFactory::~ShortcutManagerFactory() { } ProfileKeyedService* ShortcutManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new ShortcutManager(profile); + content::BrowserContext* profile) const { + return new ShortcutManager(static_cast<Profile*>(profile)); } bool ShortcutManagerFactory::ServiceIsCreatedWithProfile() const { diff --git a/apps/shortcut_manager_factory.h b/apps/shortcut_manager_factory.h index 946fba2..bed2136 100644 --- a/apps/shortcut_manager_factory.h +++ b/apps/shortcut_manager_factory.h @@ -33,7 +33,7 @@ class ShortcutManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; }; diff --git a/build/linux/system.gyp b/build/linux/system.gyp index cbd2e59..b925792 100644 --- a/build/linux/system.gyp +++ b/build/linux/system.gyp @@ -43,7 +43,7 @@ }, 'conditions': [ ['_toolset=="target"', { - 'direct_dependent_settings': { + 'all_dependent_settings': { 'cflags': [ '<!@(<(pkg-config) --cflags <(gtk_packages))', ], @@ -57,7 +57,7 @@ ], }, }, { - 'direct_dependent_settings': { + 'all_dependent_settings': { 'cflags': [ '<!@(pkg-config --cflags <(gtk_packages))', ], diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc index de95e11..8b75b45 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.cc +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.cc @@ -7,6 +7,7 @@ #include "chrome/browser/autocomplete/autocomplete_classifier.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/history/shortcuts_backend_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search_engines/template_url_service_factory.h" @@ -25,8 +26,8 @@ AutocompleteClassifierFactory* AutocompleteClassifierFactory::GetInstance() { // static ProfileKeyedService* AutocompleteClassifierFactory::BuildInstanceFor( - Profile* profile) { - return new AutocompleteClassifier(profile); + content::BrowserContext* profile) { + return new AutocompleteClassifier(static_cast<Profile*>(profile)); } AutocompleteClassifierFactory::AutocompleteClassifierFactory() @@ -51,6 +52,6 @@ bool AutocompleteClassifierFactory::ServiceIsNULLWhileTesting() const { } ProfileKeyedService* AutocompleteClassifierFactory::BuildServiceInstanceFor( - Profile* profile) const { - return BuildInstanceFor(profile); + content::BrowserContext* profile) const { + return BuildInstanceFor(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.h b/chrome/browser/autocomplete/autocomplete_classifier_factory.h index 09c0c03..dc51987 100644 --- a/chrome/browser/autocomplete/autocomplete_classifier_factory.h +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.h @@ -21,7 +21,8 @@ class AutocompleteClassifierFactory : public ProfileKeyedServiceFactory { static AutocompleteClassifierFactory* GetInstance(); - static ProfileKeyedService* BuildInstanceFor(Profile* profile); + static ProfileKeyedService* BuildInstanceFor( + content::BrowserContext* profile); private: friend struct DefaultSingletonTraits<AutocompleteClassifierFactory>; @@ -33,7 +34,7 @@ class AutocompleteClassifierFactory : public ProfileKeyedServiceFactory { virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(AutocompleteClassifierFactory); }; diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc index 22a38ca..6907558 100644 --- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc @@ -68,8 +68,9 @@ class HistoryContentsProviderTest : public testing::Test, virtual bool BodyOnly() { return false; } private: - static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { - return new TemplateURLService(profile); + static ProfileKeyedService* CreateTemplateURLService( + content::BrowserContext* profile) { + return new TemplateURLService(static_cast<Profile*>(profile)); } // testing::Test diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc index 4afb262..1630ab2 100644 --- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc @@ -111,8 +111,9 @@ class HistoryQuickProviderTest : public testing::Test, std::set<std::string> matches_; }; - static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { - return new TemplateURLService(profile); + static ProfileKeyedService* CreateTemplateURLService( + content::BrowserContext* profile) { + return new TemplateURLService(static_cast<Profile*>(profile)); } virtual void SetUp(); diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index 6c7b4c0..9c9667e 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -148,8 +148,9 @@ class HistoryURLProviderTest : public testing::Test, virtual void OnProviderUpdate(bool updated_matches) OVERRIDE; protected: - static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { - return new TemplateURLService(profile); + static ProfileKeyedService* CreateTemplateURLService( + content::BrowserContext* profile) { + return new TemplateURLService(static_cast<Profile*>(profile)); } // testing::Test diff --git a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc index a3a6ee0..3024606 100644 --- a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc +++ b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.cc @@ -71,9 +71,9 @@ WhitelistManagerFactory::~WhitelistManagerFactory() { ProfileKeyedService* WhitelistManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { WhitelistManagerService* service = - new WhitelistManagerServiceImpl(profile); + new WhitelistManagerServiceImpl(static_cast<Profile*>(profile)); return service; } diff --git a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h index 76e4c48..023c5ec 100644 --- a/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h +++ b/chrome/browser/autofill/autocheckout_whitelist_manager_factory.h @@ -44,7 +44,7 @@ class WhitelistManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/autofill/personal_data_manager_factory.cc b/chrome/browser/autofill/personal_data_manager_factory.cc index fd73fed..6160276 100644 --- a/chrome/browser/autofill/personal_data_manager_factory.cc +++ b/chrome/browser/autofill/personal_data_manager_factory.cc @@ -76,9 +76,9 @@ PersonalDataManagerFactory::~PersonalDataManagerFactory() { } ProfileKeyedService* PersonalDataManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { PersonalDataManagerService* service = - new PersonalDataManagerServiceImpl(profile); + new PersonalDataManagerServiceImpl(static_cast<Profile*>(profile)); return service; } diff --git a/chrome/browser/autofill/personal_data_manager_factory.h b/chrome/browser/autofill/personal_data_manager_factory.h index 217b2fa..2933216 100644 --- a/chrome/browser/autofill/personal_data_manager_factory.h +++ b/chrome/browser/autofill/personal_data_manager_factory.h @@ -44,7 +44,7 @@ class PersonalDataManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; }; diff --git a/chrome/browser/background/background_contents_service_factory.cc b/chrome/browser/background/background_contents_service_factory.cc index 172ecfe..a47b4b4 100644 --- a/chrome/browser/background/background_contents_service_factory.cc +++ b/chrome/browser/background/background_contents_service_factory.cc @@ -34,8 +34,8 @@ BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { } ProfileKeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new BackgroundContentsService(profile, + content::BrowserContext* profile) const { + return new BackgroundContentsService(static_cast<Profile*>(profile), CommandLine::ForCurrentProcess()); } diff --git a/chrome/browser/background/background_contents_service_factory.h b/chrome/browser/background/background_contents_service_factory.h index 2c77ba9..08fa8b7 100644 --- a/chrome/browser/background/background_contents_service_factory.h +++ b/chrome/browser/background/background_contents_service_factory.h @@ -30,7 +30,7 @@ class BackgroundContentsServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; // Use a separate background contents service for incognito. virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; diff --git a/chrome/browser/bookmarks/bookmark_model_factory.cc b/chrome/browser/bookmarks/bookmark_model_factory.cc index 73da8cb..1080f64 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.cc +++ b/chrome/browser/bookmarks/bookmark_model_factory.cc @@ -39,7 +39,8 @@ BookmarkModelFactory::BookmarkModelFactory() BookmarkModelFactory::~BookmarkModelFactory() {} ProfileKeyedService* BookmarkModelFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); bookmark_model->Load(StartupTaskRunnerServiceFactory::GetForProfile(profile)-> GetBookmarkTaskRunner()); diff --git a/chrome/browser/bookmarks/bookmark_model_factory.h b/chrome/browser/bookmarks/bookmark_model_factory.h index f38bcb5..c0999e5 100644 --- a/chrome/browser/bookmarks/bookmark_model_factory.h +++ b/chrome/browser/bookmarks/bookmark_model_factory.h @@ -33,7 +33,7 @@ class BookmarkModelFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/captive_portal/captive_portal_service_factory.cc b/chrome/browser/captive_portal/captive_portal_service_factory.cc index 26f49b2..474a18a 100644 --- a/chrome/browser/captive_portal/captive_portal_service_factory.cc +++ b/chrome/browser/captive_portal/captive_portal_service_factory.cc @@ -31,8 +31,8 @@ CaptivePortalServiceFactory::~CaptivePortalServiceFactory() { } ProfileKeyedService* CaptivePortalServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new CaptivePortalService(profile); + content::BrowserContext* profile) const { + return new CaptivePortalService(static_cast<Profile*>(profile)); } bool CaptivePortalServiceFactory::ServiceHasOwnInstanceInIncognito() const { diff --git a/chrome/browser/captive_portal/captive_portal_service_factory.h b/chrome/browser/captive_portal/captive_portal_service_factory.h index 0cbcfd8..e8e84f9 100644 --- a/chrome/browser/captive_portal/captive_portal_service_factory.h +++ b/chrome/browser/captive_portal/captive_portal_service_factory.h @@ -37,7 +37,7 @@ class CaptivePortalServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(CaptivePortalServiceFactory); diff --git a/chrome/browser/chrome_to_mobile_service_factory.cc b/chrome/browser/chrome_to_mobile_service_factory.cc index d2c6601..413106d 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.cc +++ b/chrome/browser/chrome_to_mobile_service_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/chrome_to_mobile_service_factory.h" #include "chrome/browser/chrome_to_mobile_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/signin/token_service_factory.h" #include "chrome/browser/sync/profile_sync_service_factory.h" @@ -22,12 +23,12 @@ ChromeToMobileService* ChromeToMobileServiceFactory::GetForProfile( } ProfileKeyedService* ChromeToMobileServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { // Ensure that the service is not instantiated or used if it is disabled. if (!ChromeToMobileService::IsChromeToMobileEnabled()) return NULL; - return new ChromeToMobileService(profile); + return new ChromeToMobileService(static_cast<Profile*>(profile)); } ChromeToMobileServiceFactory::ChromeToMobileServiceFactory() diff --git a/chrome/browser/chrome_to_mobile_service_factory.h b/chrome/browser/chrome_to_mobile_service_factory.h index 5232a7f..4953079 100644 --- a/chrome/browser/chrome_to_mobile_service_factory.h +++ b/chrome/browser/chrome_to_mobile_service_factory.h @@ -22,7 +22,7 @@ class ChromeToMobileServiceFactory : public ProfileKeyedServiceFactory { protected: // ProfileKeyedServiceFactory overrides: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; private: friend struct DefaultSingletonTraits<ChromeToMobileServiceFactory>; diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc index 9225979..1e742cb 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc @@ -90,8 +90,8 @@ KioskAppUpdateServiceFactory* KioskAppUpdateServiceFactory::GetInstance() { } ProfileKeyedService* KioskAppUpdateServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new KioskAppUpdateService(profile); + content::BrowserContext* profile) const { + return new KioskAppUpdateService(static_cast<Profile*>(profile)); } } // namespace chromeos diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h index 5b529ee..8bde271 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h +++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h @@ -67,7 +67,7 @@ class KioskAppUpdateServiceFactory: public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory overrides: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; } // namespace chromeos diff --git a/chrome/browser/chromeos/drive/drive_system_service.cc b/chrome/browser/chromeos/drive/drive_system_service.cc index 1d0f039..44f3c7c 100644 --- a/chrome/browser/chromeos/drive/drive_system_service.cc +++ b/chrome/browser/chromeos/drive/drive_system_service.cc @@ -417,7 +417,9 @@ DriveSystemServiceFactory::~DriveSystemServiceFactory() { } ProfileKeyedService* DriveSystemServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + DriveSystemService* service = NULL; if (factory_for_test_.is_null()) service = new DriveSystemService(profile, NULL, base::FilePath(), NULL); diff --git a/chrome/browser/chromeos/drive/drive_system_service.h b/chrome/browser/chromeos/drive/drive_system_service.h index 9619146..a06f614 100644 --- a/chrome/browser/chromeos/drive/drive_system_service.h +++ b/chrome/browser/chromeos/drive/drive_system_service.h @@ -217,7 +217,7 @@ class DriveSystemServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; FactoryCallback factory_for_test_; }; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc index 9436d24..992c034 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.cc @@ -34,9 +34,9 @@ FileBrowserPrivateAPIFactory::FileBrowserPrivateAPIFactory() FileBrowserPrivateAPIFactory::~FileBrowserPrivateAPIFactory() { } -ProfileKeyedService* -FileBrowserPrivateAPIFactory::BuildServiceInstanceFor(Profile* profile) const { - return new FileBrowserPrivateAPI(profile); +ProfileKeyedService* FileBrowserPrivateAPIFactory::BuildServiceInstanceFor( + content::BrowserContext* profile) const { + return new FileBrowserPrivateAPI(static_cast<Profile*>(profile)); } bool FileBrowserPrivateAPIFactory::ServiceHasOwnInstanceInIncognito() const { diff --git a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h index 9f7678f..c0f1ec5 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h +++ b/chrome/browser/chromeos/extensions/file_manager/file_browser_private_api_factory.h @@ -33,8 +33,8 @@ class FileBrowserPrivateAPIFactory : public ProfileKeyedServiceFactory { virtual ~FileBrowserPrivateAPIFactory(); // ProfileKeyedServiceFactory: - virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) - const OVERRIDE; + virtual ProfileKeyedService* BuildServiceInstanceFor( + content::BrowserContext* profile) const OVERRIDE; }; #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_BROWSER_PRIVATE_API_FACTORY_H_ diff --git a/chrome/browser/chromeos/extensions/install_limiter_factory.cc b/chrome/browser/chromeos/extensions/install_limiter_factory.cc index 258c56a..3cb25c8 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_factory.cc +++ b/chrome/browser/chromeos/extensions/install_limiter_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/chromeos/extensions/install_limiter.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -31,7 +32,7 @@ InstallLimiterFactory::~InstallLimiterFactory() { } ProfileKeyedService* InstallLimiterFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new InstallLimiter(); } diff --git a/chrome/browser/chromeos/extensions/install_limiter_factory.h b/chrome/browser/chromeos/extensions/install_limiter_factory.h index c291e93..af43fe6 100644 --- a/chrome/browser/chromeos/extensions/install_limiter_factory.h +++ b/chrome/browser/chromeos/extensions/install_limiter_factory.h @@ -31,7 +31,7 @@ class InstallLimiterFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory overrides: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(InstallLimiterFactory); }; diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc index dff2b2c..5597b1d 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc +++ b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.cc @@ -36,8 +36,8 @@ NetworkingPrivateEventRouterFactory::~NetworkingPrivateEventRouterFactory() { ProfileKeyedService* NetworkingPrivateEventRouterFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new NetworkingPrivateEventRouter(profile); + content::BrowserContext* profile) const { + return new NetworkingPrivateEventRouter(static_cast<Profile*>(profile)); } bool diff --git a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h index 5f7cfc6..89f181c 100644 --- a/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h +++ b/chrome/browser/chromeos/extensions/networking_private_event_router_factory.h @@ -40,7 +40,7 @@ class NetworkingPrivateEventRouterFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateEventRouterFactory); }; diff --git a/chrome/browser/content_settings/cookie_settings.cc b/chrome/browser/content_settings/cookie_settings.cc index e0b1ff6..9c6e6f0 100644 --- a/chrome/browser/content_settings/cookie_settings.cc +++ b/chrome/browser/content_settings/cookie_settings.cc @@ -77,7 +77,9 @@ bool CookieSettings::Factory::ServiceRedirectedInIncognito() const { } scoped_refptr<RefcountedProfileKeyedService> -CookieSettings::Factory::BuildServiceInstanceFor(Profile* profile) const { +CookieSettings::Factory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); return new CookieSettings(profile->GetHostContentSettingsMap(), profile->GetPrefs()); } diff --git a/chrome/browser/content_settings/cookie_settings.h b/chrome/browser/content_settings/cookie_settings.h index 4505db3..f3fb36c 100644 --- a/chrome/browser/content_settings/cookie_settings.h +++ b/chrome/browser/content_settings/cookie_settings.h @@ -123,7 +123,8 @@ class CookieSettings virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual scoped_refptr<RefcountedProfileKeyedService> - BuildServiceInstanceFor(Profile* profile) const OVERRIDE; + BuildServiceInstanceFor( + content::BrowserContext* context) const OVERRIDE; }; private: diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc index eaebd5e..e144cd5 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.cc @@ -50,9 +50,9 @@ bool ProtocolHandlerRegistryFactory::ServiceIsNULLWhileTesting() const { } ProfileKeyedService* ProtocolHandlerRegistryFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { ProtocolHandlerRegistry* registry = new ProtocolHandlerRegistry( - profile, new ProtocolHandlerRegistry::Delegate()); + static_cast<Profile*>(profile), new ProtocolHandlerRegistry::Delegate()); #if defined(OS_CHROMEOS) // If installing defaults, they must be installed prior calling diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_factory.h b/chrome/browser/custom_handlers/protocol_handler_registry_factory.h index c708217..e935106 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_factory.h +++ b/chrome/browser/custom_handlers/protocol_handler_registry_factory.h @@ -39,7 +39,7 @@ class ProtocolHandlerRegistryFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ProtocolHandlerRegistryFactory); }; diff --git a/chrome/browser/download/download_service_factory.cc b/chrome/browser/download/download_service_factory.cc index 192db82..f724992 100644 --- a/chrome/browser/download/download_service_factory.cc +++ b/chrome/browser/download/download_service_factory.cc @@ -30,8 +30,9 @@ DownloadServiceFactory::~DownloadServiceFactory() { } ProfileKeyedService* DownloadServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - DownloadService* service = new DownloadService(profile); + content::BrowserContext* profile) const { + DownloadService* service = + new DownloadService(static_cast<Profile*>(profile)); // No need for initialization; initialization can be done on first // use of service. diff --git a/chrome/browser/download/download_service_factory.h b/chrome/browser/download/download_service_factory.h index 6a7713d..05578ee 100644 --- a/chrome/browser/download/download_service_factory.h +++ b/chrome/browser/download/download_service_factory.h @@ -25,7 +25,7 @@ class DownloadServiceFactory : public ProfileKeyedServiceFactory { protected: // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; private: diff --git a/chrome/browser/extensions/activity_log.cc b/chrome/browser/extensions/activity_log.cc index 63a2de8..89d966d 100644 --- a/chrome/browser/extensions/activity_log.cc +++ b/chrome/browser/extensions/activity_log.cc @@ -130,8 +130,8 @@ ActivityLogFactory* ActivityLogFactory::GetInstance() { } ProfileKeyedService* ActivityLogFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new ActivityLog(profile); + content::BrowserContext* profile) const { + return new ActivityLog(static_cast<Profile*>(profile)); } bool ActivityLogFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/extensions/activity_log.h b/chrome/browser/extensions/activity_log.h index 2095d7a..7c31828 100644 --- a/chrome/browser/extensions/activity_log.h +++ b/chrome/browser/extensions/activity_log.h @@ -237,7 +237,7 @@ class ActivityLogFactory : public ProfileKeyedServiceFactory { virtual ~ActivityLogFactory() {} virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc index b1b2f60..22d346f 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -31,7 +32,7 @@ AutotestPrivateAPIFactory::~AutotestPrivateAPIFactory() { } ProfileKeyedService* AutotestPrivateAPIFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new AutotestPrivateAPI(); } diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h index e79ec9e..586c982 100644 --- a/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h +++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api_factory.h @@ -25,7 +25,7 @@ class AutotestPrivateAPIFactory : public ProfileKeyedServiceFactory { // ProfileKeyedBaseFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc index 2a07f5c..c57ef5d 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -31,8 +32,8 @@ BluetoothAPIFactory::~BluetoothAPIFactory() { } ProfileKeyedService* BluetoothAPIFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new BluetoothAPI(profile); + content::BrowserContext* profile) const { + return new BluetoothAPI(static_cast<Profile*>(profile)); } bool BluetoothAPIFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h index ff1a76b..c83333b 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_api_factory.h @@ -26,7 +26,7 @@ class BluetoothAPIFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc index f1ab5d6..fe1efe2 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/api/developer_private/developer_private_api.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -32,8 +33,8 @@ DeveloperPrivateAPIFactory::~DeveloperPrivateAPIFactory() { } ProfileKeyedService* DeveloperPrivateAPIFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new DeveloperPrivateAPI(profile); + content::BrowserContext* profile) const { + return new DeveloperPrivateAPI(static_cast<Profile*>(profile)); } bool DeveloperPrivateAPIFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h index c1ef9f6..faf5827 100644 --- a/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h +++ b/chrome/browser/extensions/api/developer_private/developer_private_api_factory.h @@ -28,7 +28,7 @@ class DeveloperPrivateAPIFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/extensions/api/dial/dial_api_factory.cc b/chrome/browser/extensions/api/dial/dial_api_factory.cc index b9a6017..4466010 100644 --- a/chrome/browser/extensions/api/dial/dial_api_factory.cc +++ b/chrome/browser/extensions/api/dial/dial_api_factory.cc @@ -30,8 +30,9 @@ DialAPIFactory::~DialAPIFactory() { } scoped_refptr<RefcountedProfileKeyedService> - DialAPIFactory::BuildServiceInstanceFor(Profile* profile) const { - return scoped_refptr<DialAPI>(new DialAPI(profile)); + DialAPIFactory::BuildServiceInstanceFor( + content::BrowserContext* profile) const { + return scoped_refptr<DialAPI>(new DialAPI(static_cast<Profile*>(profile))); } bool DialAPIFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/extensions/api/dial/dial_api_factory.h b/chrome/browser/extensions/api/dial/dial_api_factory.h index 1a6664d..878d926 100644 --- a/chrome/browser/extensions/api/dial/dial_api_factory.h +++ b/chrome/browser/extensions/api/dial/dial_api_factory.h @@ -26,7 +26,7 @@ class DialAPIFactory : public RefcountedProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc index 6939271..278f0cf 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/api/discovery/suggested_links_registry.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -36,7 +37,7 @@ SuggestedLinksRegistryFactory::~SuggestedLinksRegistryFactory() { } ProfileKeyedService* SuggestedLinksRegistryFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new SuggestedLinksRegistry(); } diff --git a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h index c7c6686..d53c0d4 100644 --- a/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h +++ b/chrome/browser/extensions/api/discovery/suggested_links_registry_factory.h @@ -30,7 +30,7 @@ class SuggestedLinksRegistryFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(SuggestedLinksRegistryFactory); diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index 0b04145..1004336 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -182,8 +182,8 @@ class TestOAuth2MintTokenFlow : public OAuth2MintTokenFlow { OAuth2MintTokenFlow::Delegate* delegate_; }; -ProfileKeyedService* IdentityAPITestFactory(Profile* profile) { - return new IdentityAPI(profile); +ProfileKeyedService* IdentityAPITestFactory(content::BrowserContext* profile) { + return new IdentityAPI(static_cast<Profile*>(profile)); } } // namespace diff --git a/chrome/browser/extensions/api/idle/idle_api_unittest.cc b/chrome/browser/extensions/api/idle/idle_api_unittest.cc index 94d2c8d..22f0fb1 100644 --- a/chrome/browser/extensions/api/idle/idle_api_unittest.cc +++ b/chrome/browser/extensions/api/idle/idle_api_unittest.cc @@ -118,8 +118,8 @@ ScopedListen::~ScopedListen() { idle_manager_->OnListenerRemoved(details); } -ProfileKeyedService* IdleManagerTestFactory(Profile* profile) { - return new IdleManager(profile); +ProfileKeyedService* IdleManagerTestFactory(content::BrowserContext* profile) { + return new IdleManager(static_cast<Profile*>(profile)); } } // namespace diff --git a/chrome/browser/extensions/api/idle/idle_manager_factory.cc b/chrome/browser/extensions/api/idle/idle_manager_factory.cc index 84df8cb..47fec2b 100644 --- a/chrome/browser/extensions/api/idle/idle_manager_factory.cc +++ b/chrome/browser/extensions/api/idle/idle_manager_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/api/idle/idle_manager.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -32,8 +33,8 @@ IdleManagerFactory::~IdleManagerFactory() { } ProfileKeyedService* IdleManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { - IdleManager* idle_manager = new IdleManager(profile); + content::BrowserContext* profile) const { + IdleManager* idle_manager = new IdleManager(static_cast<Profile*>(profile)); idle_manager->Init(); return idle_manager; } diff --git a/chrome/browser/extensions/api/idle/idle_manager_factory.h b/chrome/browser/extensions/api/idle/idle_manager_factory.h index 8f902dc..5223657 100644 --- a/chrome/browser/extensions/api/idle/idle_manager_factory.h +++ b/chrome/browser/extensions/api/idle/idle_manager_factory.h @@ -25,7 +25,7 @@ class IdleManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedBaseFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/extensions/api/profile_keyed_api_factory.h b/chrome/browser/extensions/api/profile_keyed_api_factory.h index 1ddfac3..bddeea4 100644 --- a/chrome/browser/extensions/api/profile_keyed_api_factory.h +++ b/chrome/browser/extensions/api/profile_keyed_api_factory.h @@ -6,6 +6,7 @@ #define CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_ #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/profiles/profile_keyed_service_factory.h" @@ -86,8 +87,8 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory { private: // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE { - return new T(profile); + content::BrowserContext* profile) const OVERRIDE { + return new T(static_cast<Profile*>(profile)); } // ProfileKeyedBaseFactory implementation. diff --git a/chrome/browser/extensions/api/storage/settings_test_util.cc b/chrome/browser/extensions/api/storage/settings_test_util.cc index f201a44..d3c4b7d 100644 --- a/chrome/browser/extensions/api/storage/settings_test_util.cc +++ b/chrome/browser/extensions/api/storage/settings_test_util.cc @@ -124,8 +124,9 @@ ExtensionService* MockExtensionSystem::extension_service() { return static_cast<ExtensionService*>(as_interface); } -ProfileKeyedService* BuildMockExtensionSystem(Profile* profile) { - return new MockExtensionSystem(profile); +ProfileKeyedService* BuildMockExtensionSystem( + content::BrowserContext* profile) { + return new MockExtensionSystem(static_cast<Profile*>(profile)); } // MockProfile diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc index 8276a905..b349336 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync_file_system/sync_file_system_service_factory.h" @@ -34,8 +35,8 @@ ExtensionSyncEventObserverFactory::ExtensionSyncEventObserverFactory() ExtensionSyncEventObserverFactory::~ExtensionSyncEventObserverFactory() {} ProfileKeyedService* ExtensionSyncEventObserverFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new ExtensionSyncEventObserver(profile); + content::BrowserContext* profile) const { + return new ExtensionSyncEventObserver(static_cast<Profile*>(profile)); } } // namespace extensions diff --git a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h index f7363d4..c394e77 100644 --- a/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h +++ b/chrome/browser/extensions/api/sync_file_system/extension_sync_event_observer_factory.h @@ -26,7 +26,7 @@ class ExtensionSyncEventObserverFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc index b5b3ae7..a21ee53 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.cc @@ -7,6 +7,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/extensions/api/system_indicator/system_indicator_manager.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -32,13 +33,14 @@ SystemIndicatorManagerFactory::SystemIndicatorManagerFactory() SystemIndicatorManagerFactory::~SystemIndicatorManagerFactory() {} ProfileKeyedService* SystemIndicatorManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { StatusTray* status_tray = g_browser_process->status_tray(); if (status_tray == NULL) return NULL; - return new SystemIndicatorManager(profile, status_tray); + return new SystemIndicatorManager(static_cast<Profile*>(profile), + status_tray); } } // namespace extensions diff --git a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h index bb07769..a1311cf 100644 --- a/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h +++ b/chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h @@ -26,7 +26,7 @@ class SystemIndicatorManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedBaseFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; } // namespace extensions diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc index c30ec0a..76d852d 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.cc @@ -7,6 +7,7 @@ #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" #include "chrome/browser/extensions/api/discovery/suggested_links_registry.h" #include "chrome/browser/extensions/extension_system_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -36,8 +37,8 @@ TabCaptureRegistryFactory::~TabCaptureRegistryFactory() { } ProfileKeyedService* TabCaptureRegistryFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new TabCaptureRegistry(profile); + content::BrowserContext* profile) const { + return new TabCaptureRegistry(static_cast<Profile*>(profile)); } bool TabCaptureRegistryFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h index 8b9e35f..0db64bf 100644 --- a/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h +++ b/chrome/browser/extensions/api/tab_capture/tab_capture_registry_factory.h @@ -29,7 +29,7 @@ class TabCaptureRegistryFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TabCaptureRegistryFactory); diff --git a/chrome/browser/extensions/extension_action_manager.cc b/chrome/browser/extensions/extension_action_manager.cc index 2dd3a27e..0ddb1dd 100644 --- a/chrome/browser/extensions/extension_action_manager.cc +++ b/chrome/browser/extensions/extension_action_manager.cc @@ -44,8 +44,8 @@ class ExtensionActionManagerFactory : public ProfileKeyedServiceFactory { } virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE { - return new ExtensionActionManager(profile); + content::BrowserContext* profile) const OVERRIDE { + return new ExtensionActionManager(static_cast<Profile*>(profile)); } virtual bool ServiceRedirectedInIncognito() const OVERRIDE { diff --git a/chrome/browser/extensions/extension_pref_value_map_factory.cc b/chrome/browser/extensions/extension_pref_value_map_factory.cc index 195bab4..3220307 100644 --- a/chrome/browser/extensions/extension_pref_value_map_factory.cc +++ b/chrome/browser/extensions/extension_pref_value_map_factory.cc @@ -30,6 +30,6 @@ ExtensionPrefValueMapFactory* ExtensionPrefValueMapFactory::GetInstance() { } ProfileKeyedService* ExtensionPrefValueMapFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new ExtensionPrefValueMap(); } diff --git a/chrome/browser/extensions/extension_pref_value_map_factory.h b/chrome/browser/extensions/extension_pref_value_map_factory.h index 10a9058..9ec0168 100644 --- a/chrome/browser/extensions/extension_pref_value_map_factory.h +++ b/chrome/browser/extensions/extension_pref_value_map_factory.h @@ -23,7 +23,7 @@ class ExtensionPrefValueMapFactory : public ProfileKeyedServiceFactory { virtual ~ExtensionPrefValueMapFactory(); virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PREF_VALUE_MAP_FACTORY_H_ diff --git a/chrome/browser/extensions/extension_system_factory.cc b/chrome/browser/extensions/extension_system_factory.cc index 19b8696..781678e 100644 --- a/chrome/browser/extensions/extension_system_factory.cc +++ b/chrome/browser/extensions/extension_system_factory.cc @@ -42,8 +42,8 @@ ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { } ProfileKeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new ExtensionSystemImpl::Shared(profile); + content::BrowserContext* profile) const { + return new ExtensionSystemImpl::Shared(static_cast<Profile*>(profile)); } bool ExtensionSystemSharedFactory::ServiceRedirectedInIncognito() const { @@ -74,8 +74,8 @@ ExtensionSystemFactory::~ExtensionSystemFactory() { } ProfileKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new ExtensionSystemImpl(profile); + content::BrowserContext* profile) const { + return new ExtensionSystemImpl(static_cast<Profile*>(profile)); } bool ExtensionSystemFactory::ServiceHasOwnInstanceInIncognito() const { diff --git a/chrome/browser/extensions/extension_system_factory.h b/chrome/browser/extensions/extension_system_factory.h index f2f4617..dd0ae55 100644 --- a/chrome/browser/extensions/extension_system_factory.h +++ b/chrome/browser/extensions/extension_system_factory.h @@ -31,7 +31,7 @@ class ExtensionSystemSharedFactory : public ProfileKeyedServiceFactory { virtual ~ExtensionSystemSharedFactory(); virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; }; @@ -50,7 +50,7 @@ class ExtensionSystemFactory : public ProfileKeyedServiceFactory { virtual ~ExtensionSystemFactory(); virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; }; diff --git a/chrome/browser/extensions/image_loader_factory.cc b/chrome/browser/extensions/image_loader_factory.cc index 21ad9ad..b352f11 100644 --- a/chrome/browser/extensions/image_loader_factory.cc +++ b/chrome/browser/extensions/image_loader_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/extensions/image_loader_factory.h" #include "chrome/browser/extensions/image_loader.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -35,7 +36,7 @@ ImageLoaderFactory::~ImageLoaderFactory() { } ProfileKeyedService* ImageLoaderFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new ImageLoader; } diff --git a/chrome/browser/extensions/image_loader_factory.h b/chrome/browser/extensions/image_loader_factory.h index 767316b..850c5fc 100644 --- a/chrome/browser/extensions/image_loader_factory.h +++ b/chrome/browser/extensions/image_loader_factory.h @@ -33,7 +33,7 @@ class ImageLoaderFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; }; diff --git a/chrome/browser/extensions/install_tracker_factory.cc b/chrome/browser/extensions/install_tracker_factory.cc index c85a222..820404a 100644 --- a/chrome/browser/extensions/install_tracker_factory.cc +++ b/chrome/browser/extensions/install_tracker_factory.cc @@ -9,6 +9,7 @@ #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/install_tracker.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace extensions { @@ -33,7 +34,8 @@ InstallTrackerFactory::~InstallTrackerFactory() { } ProfileKeyedService* InstallTrackerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); ExtensionService* service = extensions::ExtensionSystem::Get(profile)->extension_service(); return new InstallTracker(profile, service->extension_prefs()); diff --git a/chrome/browser/extensions/install_tracker_factory.h b/chrome/browser/extensions/install_tracker_factory.h index 88e9295..f3c44f0 100644 --- a/chrome/browser/extensions/install_tracker_factory.h +++ b/chrome/browser/extensions/install_tracker_factory.h @@ -28,7 +28,7 @@ class InstallTrackerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory overrides: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index 7e6f872..bd60d8c 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -489,8 +489,9 @@ class MockExtensionSystem : public TestExtensionSystem { DISALLOW_COPY_AND_ASSIGN(MockExtensionSystem); }; -ProfileKeyedService* BuildMockExtensionSystem(Profile* profile) { - return new MockExtensionSystem(profile); +ProfileKeyedService* BuildMockExtensionSystem( + content::BrowserContext* profile) { + return new MockExtensionSystem(static_cast<Profile*>(profile)); } // Tests the RemoveAll functionality. diff --git a/chrome/browser/extensions/shell_window_registry.cc b/chrome/browser/extensions/shell_window_registry.cc index f8ef9c6..e08b04a 100644 --- a/chrome/browser/extensions/shell_window_registry.cc +++ b/chrome/browser/extensions/shell_window_registry.cc @@ -245,8 +245,8 @@ ShellWindowRegistry::Factory::~Factory() { } ProfileKeyedService* ShellWindowRegistry::Factory::BuildServiceInstanceFor( - Profile* profile) const { - return new ShellWindowRegistry(profile); + content::BrowserContext* profile) const { + return new ShellWindowRegistry(static_cast<Profile*>(profile)); } bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() const { diff --git a/chrome/browser/extensions/shell_window_registry.h b/chrome/browser/extensions/shell_window_registry.h index 155e19a..3789333 100644 --- a/chrome/browser/extensions/shell_window_registry.h +++ b/chrome/browser/extensions/shell_window_registry.h @@ -115,7 +115,7 @@ class ShellWindowRegistry : public ProfileKeyedService { // ProfileKeyedServiceFactory virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/extensions/test_extension_system.cc b/chrome/browser/extensions/test_extension_system.cc index ebd4888c..ad96e96 100644 --- a/chrome/browser/extensions/test_extension_system.cc +++ b/chrome/browser/extensions/test_extension_system.cc @@ -186,8 +186,9 @@ Blacklist* TestExtensionSystem::blacklist() { } // static -ProfileKeyedService* TestExtensionSystem::Build(Profile* profile) { - return new TestExtensionSystem(profile); +ProfileKeyedService* TestExtensionSystem::Build( + content::BrowserContext* profile) { + return new TestExtensionSystem(static_cast<Profile*>(profile)); } } // namespace extensions diff --git a/chrome/browser/extensions/test_extension_system.h b/chrome/browser/extensions/test_extension_system.h index 48960c0..09762db 100644 --- a/chrome/browser/extensions/test_extension_system.h +++ b/chrome/browser/extensions/test_extension_system.h @@ -14,6 +14,10 @@ class FilePath; class Time; } +namespace content { +class BrowserContext; +} + namespace extensions { // Test ExtensionSystem, for use with TestingProfile. @@ -70,7 +74,7 @@ class TestExtensionSystem : public ExtensionSystem { virtual Blacklist* blacklist() OVERRIDE; // Factory method for tests to use with SetTestingProfile. - static ProfileKeyedService* Build(Profile* profile); + static ProfileKeyedService* Build(content::BrowserContext* profile); protected: Profile* profile_; diff --git a/chrome/browser/extensions/token_cache/token_cache_service_factory.cc b/chrome/browser/extensions/token_cache/token_cache_service_factory.cc index ca0ffb7..5fbe132 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service_factory.cc +++ b/chrome/browser/extensions/token_cache/token_cache_service_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/extensions/token_cache/token_cache_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" // static @@ -29,6 +30,6 @@ TokenCacheServiceFactory::~TokenCacheServiceFactory() { } ProfileKeyedService* TokenCacheServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new extensions::TokenCacheService(profile); + content::BrowserContext* profile) const { + return new extensions::TokenCacheService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/extensions/token_cache/token_cache_service_factory.h b/chrome/browser/extensions/token_cache/token_cache_service_factory.h index c4b213f..0d28101 100644 --- a/chrome/browser/extensions/token_cache/token_cache_service_factory.h +++ b/chrome/browser/extensions/token_cache/token_cache_service_factory.h @@ -26,7 +26,7 @@ class TokenCacheServiceFactory : public ProfileKeyedServiceFactory { // Inherited from ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TokenCacheServiceFactory); }; diff --git a/chrome/browser/favicon/favicon_service_factory.cc b/chrome/browser/favicon/favicon_service_factory.cc index f3f7d83..e59733f 100644 --- a/chrome/browser/favicon/favicon_service_factory.cc +++ b/chrome/browser/favicon/favicon_service_factory.cc @@ -44,9 +44,9 @@ FaviconServiceFactory::FaviconServiceFactory() FaviconServiceFactory::~FaviconServiceFactory() {} ProfileKeyedService* FaviconServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { HistoryService* history_service = HistoryServiceFactory::GetForProfile( - profile, Profile::EXPLICIT_ACCESS); + static_cast<Profile*>(profile), Profile::EXPLICIT_ACCESS); return new FaviconService(history_service); } diff --git a/chrome/browser/favicon/favicon_service_factory.h b/chrome/browser/favicon/favicon_service_factory.h index 052f8e2..7755b35 100644 --- a/chrome/browser/favicon/favicon_service_factory.h +++ b/chrome/browser/favicon/favicon_service_factory.h @@ -33,7 +33,7 @@ class FaviconServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(FaviconServiceFactory); diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc index 407a376..9bb0874 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" @@ -67,8 +68,8 @@ ChromeGeolocationPermissionContextFactory:: ProfileKeyedService* ChromeGeolocationPermissionContextFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new Service(profile); + content::BrowserContext* profile) const { + return new Service(static_cast<Profile*>(profile)); } void ChromeGeolocationPermissionContextFactory::RegisterUserPrefs( diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h index 7f23846..e029f7f 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_factory.h @@ -30,7 +30,7 @@ class ChromeGeolocationPermissionContextFactory // |ProfileKeyedBaseFactory| methods: virtual ProfileKeyedService* - BuildServiceInstanceFor(Profile* profile) const OVERRIDE; + BuildServiceInstanceFor(content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; diff --git a/chrome/browser/google/google_url_tracker_factory.cc b/chrome/browser/google/google_url_tracker_factory.cc index f1590ec..329e5c5 100644 --- a/chrome/browser/google/google_url_tracker_factory.cc +++ b/chrome/browser/google/google_url_tracker_factory.cc @@ -7,6 +7,7 @@ #include "base/prefs/pref_service.h" #include "chrome/browser/google/google_url_tracker.h" #include "chrome/browser/google/google_url_tracker_navigation_helper_impl.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" @@ -32,10 +33,10 @@ GoogleURLTrackerFactory::~GoogleURLTrackerFactory() { } ProfileKeyedService* GoogleURLTrackerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper( new GoogleURLTrackerNavigationHelperImpl()); - return new GoogleURLTracker(profile, nav_helper.Pass(), + return new GoogleURLTracker(static_cast<Profile*>(profile), nav_helper.Pass(), GoogleURLTracker::NORMAL_MODE); } diff --git a/chrome/browser/google/google_url_tracker_factory.h b/chrome/browser/google/google_url_tracker_factory.h index 47e6624..27603d8 100644 --- a/chrome/browser/google/google_url_tracker_factory.h +++ b/chrome/browser/google/google_url_tracker_factory.h @@ -30,7 +30,7 @@ class GoogleURLTrackerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; diff --git a/chrome/browser/google_apis/drive_notification_manager_factory.cc b/chrome/browser/google_apis/drive_notification_manager_factory.cc index b2ec5e2..71c85f0 100644 --- a/chrome/browser/google_apis/drive_notification_manager_factory.cc +++ b/chrome/browser/google_apis/drive_notification_manager_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/google_apis/drive_notification_manager_factory.h" #include "chrome/browser/google_apis/drive_notification_manager.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" @@ -36,8 +37,8 @@ DriveNotificationManagerFactory::DriveNotificationManagerFactory() DriveNotificationManagerFactory::~DriveNotificationManagerFactory() {} ProfileKeyedService* DriveNotificationManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new DriveNotificationManager(profile); + content::BrowserContext* profile) const { + return new DriveNotificationManager(static_cast<Profile*>(profile)); } } // namespace google_apis diff --git a/chrome/browser/google_apis/drive_notification_manager_factory.h b/chrome/browser/google_apis/drive_notification_manager_factory.h index 0888dfa..fbcfc9a 100644 --- a/chrome/browser/google_apis/drive_notification_manager_factory.h +++ b/chrome/browser/google_apis/drive_notification_manager_factory.h @@ -28,7 +28,7 @@ class DriveNotificationManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; } // namespace google_apis diff --git a/chrome/browser/history/history_service_factory.cc b/chrome/browser/history/history_service_factory.cc index 813c0a0..fa0c2d6 100644 --- a/chrome/browser/history/history_service_factory.cc +++ b/chrome/browser/history/history_service_factory.cc @@ -64,7 +64,9 @@ HistoryServiceFactory::~HistoryServiceFactory() { } ProfileKeyedService* -HistoryServiceFactory::BuildServiceInstanceFor(Profile* profile) const { +HistoryServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); HistoryService* history_service = new HistoryService(profile); if (!history_service->Init(profile->GetPath(), BookmarkModelFactory::GetForProfile(profile))) { diff --git a/chrome/browser/history/history_service_factory.h b/chrome/browser/history/history_service_factory.h index 9927902..ba8a029 100644 --- a/chrome/browser/history/history_service_factory.h +++ b/chrome/browser/history/history_service_factory.h @@ -40,7 +40,7 @@ class HistoryServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/history/shortcuts_backend_factory.cc b/chrome/browser/history/shortcuts_backend_factory.cc index 566dbae..dbfdf53 100644 --- a/chrome/browser/history/shortcuts_backend_factory.cc +++ b/chrome/browser/history/shortcuts_backend_factory.cc @@ -6,6 +6,7 @@ #include "base/prefs/pref_service.h" #include "chrome/browser/history/shortcuts_backend.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" @@ -32,18 +33,21 @@ ShortcutsBackendFactory* ShortcutsBackendFactory::GetInstance() { // static scoped_refptr<RefcountedProfileKeyedService> -ShortcutsBackendFactory::BuildProfileForTesting(Profile* profile) { +ShortcutsBackendFactory::BuildProfileForTesting( + content::BrowserContext* profile) { scoped_refptr<history::ShortcutsBackend> backend( - new ShortcutsBackend(profile, false)); + new ShortcutsBackend(static_cast<Profile*>(profile), false)); if (backend->Init()) return backend; return NULL; } +// static scoped_refptr<RefcountedProfileKeyedService> -ShortcutsBackendFactory::BuildProfileNoDatabaseForTesting(Profile* profile) { +ShortcutsBackendFactory::BuildProfileNoDatabaseForTesting( + content::BrowserContext* profile) { scoped_refptr<history::ShortcutsBackend> backend( - new ShortcutsBackend(profile, true)); + new ShortcutsBackend(static_cast<Profile*>(profile), true)); if (backend->Init()) return backend; return NULL; @@ -58,9 +62,10 @@ ShortcutsBackendFactory::ShortcutsBackendFactory() ShortcutsBackendFactory::~ShortcutsBackendFactory() {} scoped_refptr<RefcountedProfileKeyedService> -ShortcutsBackendFactory::BuildServiceInstanceFor(Profile* profile) const { +ShortcutsBackendFactory::BuildServiceInstanceFor( + content::BrowserContext* profile) const { scoped_refptr<history::ShortcutsBackend> backend( - new ShortcutsBackend(profile, false)); + new ShortcutsBackend(static_cast<Profile*>(profile), false)); if (backend->Init()) return backend; return NULL; diff --git a/chrome/browser/history/shortcuts_backend_factory.h b/chrome/browser/history/shortcuts_backend_factory.h index 272b2d0..b15f57c 100644 --- a/chrome/browser/history/shortcuts_backend_factory.h +++ b/chrome/browser/history/shortcuts_backend_factory.h @@ -29,12 +29,12 @@ class ShortcutsBackendFactory : public RefcountedProfileKeyedServiceFactory { // Creates and returns a backend for testing purposes. static scoped_refptr<RefcountedProfileKeyedService> - BuildProfileForTesting(Profile* profile); + BuildProfileForTesting(content::BrowserContext* profile); // Creates and returns a backend but without creating its persistent database // for testing purposes. static scoped_refptr<RefcountedProfileKeyedService> - BuildProfileNoDatabaseForTesting(Profile* profile); + BuildProfileNoDatabaseForTesting(content::BrowserContext* profile); private: friend struct DefaultSingletonTraits<ShortcutsBackendFactory>; @@ -44,7 +44,7 @@ class ShortcutsBackendFactory : public RefcountedProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/history/web_history_service_factory.cc b/chrome/browser/history/web_history_service_factory.cc index 66a3b33..bc5f689 100644 --- a/chrome/browser/history/web_history_service_factory.cc +++ b/chrome/browser/history/web_history_service_factory.cc @@ -45,7 +45,9 @@ history::WebHistoryService* WebHistoryServiceFactory::GetForProfile( } ProfileKeyedService* WebHistoryServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + // Ensure that the service is not instantiated or used if the user is not // signed into sync, or if web history is not enabled. return IsHistorySyncEnabled(profile) ? diff --git a/chrome/browser/history/web_history_service_factory.h b/chrome/browser/history/web_history_service_factory.h index e37f725..00e1084 100644 --- a/chrome/browser/history/web_history_service_factory.h +++ b/chrome/browser/history/web_history_service_factory.h @@ -26,7 +26,7 @@ class WebHistoryServiceFactory : public ProfileKeyedServiceFactory { protected: // Overridden from ProfileKeyedServiceFactory. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; private: friend struct DefaultSingletonTraits<WebHistoryServiceFactory>; diff --git a/chrome/browser/managed_mode/managed_user_service_factory.cc b/chrome/browser/managed_mode/managed_user_service_factory.cc index 6215b23..ed2a3f1 100644 --- a/chrome/browser/managed_mode/managed_user_service_factory.cc +++ b/chrome/browser/managed_mode/managed_user_service_factory.cc @@ -6,6 +6,7 @@ #include "chrome/browser/extensions/extension_system_factory.h" #include "chrome/browser/managed_mode/managed_user_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" // static @@ -38,6 +39,6 @@ bool ManagedUserServiceFactory::ServiceRedirectedInIncognito() const { } ProfileKeyedService* ManagedUserServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return BuildInstanceFor(profile); + content::BrowserContext* profile) const { + return BuildInstanceFor(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/managed_mode/managed_user_service_factory.h b/chrome/browser/managed_mode/managed_user_service_factory.h index e43ea02..b4cf378 100644 --- a/chrome/browser/managed_mode/managed_user_service_factory.h +++ b/chrome/browser/managed_mode/managed_user_service_factory.h @@ -28,7 +28,7 @@ class ManagedUserServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; #endif // CHROME_BROWSER_MANAGED_MODE_MANAGED_USER_SERVICE_FACTORY_H_ diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc index 5de9773..660510e 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/media_galleries/media_galleries_preferences_factory.h" #include "chrome/browser/media_galleries/media_galleries_preferences.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" @@ -28,8 +29,8 @@ MediaGalleriesPreferencesFactory::MediaGalleriesPreferencesFactory() MediaGalleriesPreferencesFactory::~MediaGalleriesPreferencesFactory() {} ProfileKeyedService* MediaGalleriesPreferencesFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new chrome::MediaGalleriesPreferences(profile); + content::BrowserContext* profile) const { + return new chrome::MediaGalleriesPreferences(static_cast<Profile*>(profile)); } void MediaGalleriesPreferencesFactory::RegisterUserPrefs( diff --git a/chrome/browser/media_galleries/media_galleries_preferences_factory.h b/chrome/browser/media_galleries/media_galleries_preferences_factory.h index d9bbbb2..68e32cf 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_factory.h +++ b/chrome/browser/media_galleries/media_galleries_preferences_factory.h @@ -34,7 +34,7 @@ class MediaGalleriesPreferencesFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; diff --git a/chrome/browser/notifications/desktop_notification_service_factory.cc b/chrome/browser/notifications/desktop_notification_service_factory.cc index c7696b8..b8fe11b 100644 --- a/chrome/browser/notifications/desktop_notification_service_factory.cc +++ b/chrome/browser/notifications/desktop_notification_service_factory.cc @@ -35,9 +35,9 @@ DesktopNotificationServiceFactory::~DesktopNotificationServiceFactory() { } ProfileKeyedService* DesktopNotificationServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { DesktopNotificationService* service = - new DesktopNotificationService(profile, NULL); + new DesktopNotificationService(static_cast<Profile*>(profile), NULL); return service; } diff --git a/chrome/browser/notifications/desktop_notification_service_factory.h b/chrome/browser/notifications/desktop_notification_service_factory.h index 590c004..e8b7d70 100644 --- a/chrome/browser/notifications/desktop_notification_service_factory.h +++ b/chrome/browser/notifications/desktop_notification_service_factory.h @@ -31,7 +31,7 @@ class DesktopNotificationServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; // Use a separate desktop notification service for incognito. virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; }; diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc index 6642d57..8452b83 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.cc @@ -30,11 +30,13 @@ ChromeNotifierServiceFactory::~ChromeNotifierServiceFactory() { } ProfileKeyedService* -ChromeNotifierServiceFactory::BuildServiceInstanceFor(Profile* profile) const { +ChromeNotifierServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* profile) const { NotificationUIManager* notification_manager = g_browser_process->notification_ui_manager(); ChromeNotifierService* chrome_notifier_service = - new ChromeNotifierService(profile, notification_manager); + new ChromeNotifierService(static_cast<Profile*>(profile), + notification_manager); return chrome_notifier_service; } diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h index 6e6686e..9e75cce 100644 --- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h +++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h @@ -28,7 +28,7 @@ class ChromeNotifierServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; } // namespace notifier diff --git a/chrome/browser/password_manager/mock_password_store.cc b/chrome/browser/password_manager/mock_password_store.cc index ad7f753..e47f4b0 100644 --- a/chrome/browser/password_manager/mock_password_store.cc +++ b/chrome/browser/password_manager/mock_password_store.cc @@ -8,7 +8,7 @@ MockPasswordStore::MockPasswordStore() {} // static scoped_refptr<RefcountedProfileKeyedService> MockPasswordStore::Build( - Profile* profile) { + content::BrowserContext* profile) { return new MockPasswordStore; } diff --git a/chrome/browser/password_manager/mock_password_store.h b/chrome/browser/password_manager/mock_password_store.h index 5bc7720..ae58a0b 100644 --- a/chrome/browser/password_manager/mock_password_store.h +++ b/chrome/browser/password_manager/mock_password_store.h @@ -9,13 +9,16 @@ #include "content/public/common/password_form.h" #include "testing/gmock/include/gmock/gmock.h" -class Profile; +namespace content { +class BrowserContext; +} class MockPasswordStore : public PasswordStore { public: MockPasswordStore(); - static scoped_refptr<RefcountedProfileKeyedService> Build(Profile* profile); + static scoped_refptr<RefcountedProfileKeyedService> Build( + content::BrowserContext* profile); MOCK_METHOD1(RemoveLogin, void(const content::PasswordForm&)); MOCK_METHOD2(GetLogins, diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index b9fd667..a9c9800 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc @@ -95,7 +95,10 @@ LocalProfileId PasswordStoreFactory::GetLocalProfileId( #endif scoped_refptr<RefcountedProfileKeyedService> -PasswordStoreFactory::BuildServiceInstanceFor(Profile* profile) const { +PasswordStoreFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + scoped_refptr<PasswordStore> ps; base::FilePath login_db_file_path = profile->GetPath(); login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName); diff --git a/chrome/browser/password_manager/password_store_factory.h b/chrome/browser/password_manager/password_store_factory.h index 0246134..cf24607 100644 --- a/chrome/browser/password_manager/password_store_factory.h +++ b/chrome/browser/password_manager/password_store_factory.h @@ -44,7 +44,7 @@ class PasswordStoreFactory : public RefcountedProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/plugins/plugin_prefs_factory.cc b/chrome/browser/plugins/plugin_prefs_factory.cc index 32b543c..6f207bd 100644 --- a/chrome/browser/plugins/plugin_prefs_factory.cc +++ b/chrome/browser/plugins/plugin_prefs_factory.cc @@ -28,7 +28,7 @@ scoped_refptr<PluginPrefs> PluginPrefsFactory::GetPrefsForProfile( // static scoped_refptr<RefcountedProfileKeyedService> -PluginPrefsFactory::CreateForTestingProfile(Profile* profile) { +PluginPrefsFactory::CreateForTestingProfile(content::BrowserContext* profile) { return static_cast<PluginPrefs*>( GetInstance()->BuildServiceInstanceFor(profile).get()); } @@ -41,7 +41,9 @@ PluginPrefsFactory::PluginPrefsFactory() PluginPrefsFactory::~PluginPrefsFactory() {} scoped_refptr<RefcountedProfileKeyedService> -PluginPrefsFactory::BuildServiceInstanceFor(Profile* profile) const { +PluginPrefsFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); scoped_refptr<PluginPrefs> plugin_prefs(new PluginPrefs()); plugin_prefs->set_profile(profile->GetOriginalProfile()); plugin_prefs->SetPrefs(profile->GetPrefs()); diff --git a/chrome/browser/plugins/plugin_prefs_factory.h b/chrome/browser/plugins/plugin_prefs_factory.h index 73ba376..4bece4c1 100644 --- a/chrome/browser/plugins/plugin_prefs_factory.h +++ b/chrome/browser/plugins/plugin_prefs_factory.h @@ -26,14 +26,14 @@ class PluginPrefsFactory : public RefcountedProfileKeyedServiceFactory { // Helper method for PluginPrefs::GetForTestingProfile. static scoped_refptr<RefcountedProfileKeyedService> CreateForTestingProfile( - Profile* profile); + content::BrowserContext* profile); PluginPrefsFactory(); virtual ~PluginPrefsFactory(); // RefcountedProfileKeyedServiceFactory methods: virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; // ProfileKeyedServiceFactory methods: virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc index 932ad04..6ff63ac 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.cc @@ -7,6 +7,7 @@ #include "base/logging.h" #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" #include "chrome/browser/policy/cloud/user_cloud_policy_store.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" namespace policy { @@ -53,15 +54,21 @@ scoped_ptr<UserCloudPolicyManager> new policy::UserCloudPolicyManager(profile, store.Pass())); } -void UserCloudPolicyManagerFactory::ProfileShutdown(Profile* profile) { - UserCloudPolicyManager* manager = GetManagerForProfile(profile); +void UserCloudPolicyManagerFactory::ProfileShutdown( + content::BrowserContext* profile) { + UserCloudPolicyManager* manager = + GetManagerForProfile(static_cast<Profile*>(profile)); if (manager) manager->Shutdown(); } -void UserCloudPolicyManagerFactory::SetEmptyTestingFactory(Profile* profile) {} +void UserCloudPolicyManagerFactory::SetEmptyTestingFactory( + content::BrowserContext* profile) { +} -void UserCloudPolicyManagerFactory::CreateServiceNow(Profile* profile) {} +void UserCloudPolicyManagerFactory::CreateServiceNow( + content::BrowserContext* profile) { +} void UserCloudPolicyManagerFactory::Register(Profile* profile, UserCloudPolicyManager* instance) { diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h index abcbb4a..d3aca42 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h @@ -63,9 +63,10 @@ class UserCloudPolicyManagerFactory : public ProfileKeyedBaseFactory { bool force_immediate_load); // ProfileKeyedBaseFactory: - virtual void ProfileShutdown(Profile* profile) OVERRIDE; - virtual void SetEmptyTestingFactory(Profile* profile) OVERRIDE; - virtual void CreateServiceNow(Profile* profile) OVERRIDE; + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + virtual void SetEmptyTestingFactory( + content::BrowserContext* profile) OVERRIDE; + virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; // Invoked by UserCloudPolicyManager to register/unregister instances. void Register(Profile* profile, UserCloudPolicyManager* instance); diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc b/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc index cce7134..d468d38 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service_factory.cc @@ -39,8 +39,8 @@ UserPolicySigninServiceFactory* UserPolicySigninServiceFactory::GetInstance() { } ProfileKeyedService* UserPolicySigninServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new UserPolicySigninService(profile); + content::BrowserContext* profile) const { + return new UserPolicySigninService(static_cast<Profile*>(profile)); } bool UserPolicySigninServiceFactory::ServiceIsCreatedWithProfile() const { diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_factory.h b/chrome/browser/policy/cloud/user_policy_signin_service_factory.h index ef7007a..8f09a59 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_factory.h +++ b/chrome/browser/policy/cloud/user_policy_signin_service_factory.h @@ -28,7 +28,7 @@ class UserPolicySigninServiceFactory : public ProfileKeyedServiceFactory { protected: // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; // Overridden to cause this object to be created when the profile is created. virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc index 9dc136d..397753a 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc @@ -73,8 +73,8 @@ class SigninManagerFake : public FakeSigninManager { SignOut(); } - static ProfileKeyedService* Build(Profile* profile) { - return new SigninManagerFake(profile); + static ProfileKeyedService* Build(content::BrowserContext* profile) { + return new SigninManagerFake(static_cast<Profile*>(profile)); } }; } // namespace diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc index 39b1b80..e57fc1f 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc @@ -41,8 +41,8 @@ AutocompleteActionPredictorFactory::ServiceHasOwnInstanceInIncognito() const { ProfileKeyedService* AutocompleteActionPredictorFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new AutocompleteActionPredictor(profile); + content::BrowserContext* profile) const { + return new AutocompleteActionPredictor(static_cast<Profile*>(profile)); } } // namespace predictors diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.h b/chrome/browser/predictors/autocomplete_action_predictor_factory.h index 0702547..427f6ec 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.h +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.h @@ -31,7 +31,7 @@ class AutocompleteActionPredictorFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(AutocompleteActionPredictorFactory); }; diff --git a/chrome/browser/predictors/predictor_database_factory.cc b/chrome/browser/predictors/predictor_database_factory.cc index 55eafbd..e8128a3 100644 --- a/chrome/browser/predictors/predictor_database_factory.cc +++ b/chrome/browser/predictors/predictor_database_factory.cc @@ -31,8 +31,8 @@ PredictorDatabaseFactory::~PredictorDatabaseFactory() { } ProfileKeyedService* PredictorDatabaseFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new PredictorDatabase(profile); + content::BrowserContext* profile) const { + return new PredictorDatabase(static_cast<Profile*>(profile)); } } // namespace predictors diff --git a/chrome/browser/predictors/predictor_database_factory.h b/chrome/browser/predictors/predictor_database_factory.h index 4c537a8..4bfcf5a 100644 --- a/chrome/browser/predictors/predictor_database_factory.h +++ b/chrome/browser/predictors/predictor_database_factory.h @@ -29,7 +29,7 @@ class PredictorDatabaseFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(PredictorDatabaseFactory); }; diff --git a/chrome/browser/predictors/resource_prefetch_predictor_factory.cc b/chrome/browser/predictors/resource_prefetch_predictor_factory.cc index 662c00a..415cbf5 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_factory.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_factory.cc @@ -37,7 +37,9 @@ ResourcePrefetchPredictorFactory::~ResourcePrefetchPredictorFactory() {} ProfileKeyedService* ResourcePrefetchPredictorFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + ResourcePrefetchPredictorConfig config; if (!IsSpeculativeResourcePrefetchingEnabled(profile, &config)) return NULL; diff --git a/chrome/browser/predictors/resource_prefetch_predictor_factory.h b/chrome/browser/predictors/resource_prefetch_predictor_factory.h index 0c63bcb..f40c38a 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_factory.h +++ b/chrome/browser/predictors/resource_prefetch_predictor_factory.h @@ -26,7 +26,7 @@ class ResourcePrefetchPredictorFactory : public ProfileKeyedServiceFactory { // RefcountedProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ResourcePrefetchPredictorFactory); }; diff --git a/chrome/browser/prerender/prerender_link_manager_factory.cc b/chrome/browser/prerender/prerender_link_manager_factory.cc index b3eb0be..25ab8a9 100644 --- a/chrome/browser/prerender/prerender_link_manager_factory.cc +++ b/chrome/browser/prerender/prerender_link_manager_factory.cc @@ -31,9 +31,9 @@ PrerenderLinkManagerFactory::PrerenderLinkManagerFactory() } ProfileKeyedService* PrerenderLinkManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { PrerenderManager* prerender_manager = - PrerenderManagerFactory::GetForProfile(profile); + PrerenderManagerFactory::GetForProfile(static_cast<Profile*>(profile)); if (!prerender_manager) return NULL; PrerenderLinkManager* prerender_link_manager = diff --git a/chrome/browser/prerender/prerender_link_manager_factory.h b/chrome/browser/prerender/prerender_link_manager_factory.h index bb9c025..f5ad797 100644 --- a/chrome/browser/prerender/prerender_link_manager_factory.h +++ b/chrome/browser/prerender/prerender_link_manager_factory.h @@ -27,7 +27,7 @@ class PrerenderLinkManagerFactory : public ProfileKeyedServiceFactory { virtual ~PrerenderLinkManagerFactory() { } virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; }; diff --git a/chrome/browser/prerender/prerender_manager_factory.cc b/chrome/browser/prerender/prerender_manager_factory.cc index 6d9cdb4..8b583bc 100644 --- a/chrome/browser/prerender/prerender_manager_factory.cc +++ b/chrome/browser/prerender/prerender_manager_factory.cc @@ -46,10 +46,10 @@ PrerenderManagerFactory::~PrerenderManagerFactory() { } ProfileKeyedService* PrerenderManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { CHECK(g_browser_process->prerender_tracker()); PrerenderManager* prerender_manager = new PrerenderManager( - profile, g_browser_process->prerender_tracker()); + static_cast<Profile*>(profile), g_browser_process->prerender_tracker()); #if defined(OS_CHROMEOS) if (chromeos::CrosLibrary::Get()) { prerender_manager->AddCondition( diff --git a/chrome/browser/prerender/prerender_manager_factory.h b/chrome/browser/prerender/prerender_manager_factory.h index 16308b3..3f345e4 100644 --- a/chrome/browser/prerender/prerender_manager_factory.h +++ b/chrome/browser/prerender/prerender_manager_factory.h @@ -33,7 +33,7 @@ class PrerenderManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; // Prerendering is allowed in incognito. virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc index 44161c3..dd092c2 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h" #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" // static @@ -27,8 +28,9 @@ CloudPrintProxyServiceFactory::~CloudPrintProxyServiceFactory() { } ProfileKeyedService* CloudPrintProxyServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - CloudPrintProxyService* service = new CloudPrintProxyService(profile); + content::BrowserContext* profile) const { + CloudPrintProxyService* service = + new CloudPrintProxyService(static_cast<Profile*>(profile)); service->Initialize(); return service; diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h index b829c4f..104c314 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.h @@ -31,7 +31,7 @@ class CloudPrintProxyServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc index b186458..c92d30b 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc @@ -422,8 +422,10 @@ TEST_F(CloudPrintProxyPolicyTest, prefs->GetString(prefs::kCloudPrintEmail)); } -ProfileKeyedService* TestCloudPrintProxyServiceFactory(Profile* profile) { - TestCloudPrintProxyService* service = new TestCloudPrintProxyService(profile); +ProfileKeyedService* TestCloudPrintProxyServiceFactory( + content::BrowserContext* profile) { + TestCloudPrintProxyService* service = + new TestCloudPrintProxyService(static_cast<Profile*>(profile)); service->GetMockServiceProcessControl()->SetConnectSuccessMockExpectations( MockServiceProcessControl::kServiceStateEnabled, true); diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index 0dbf333..960ccf2 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -456,8 +456,9 @@ TEST_F(CloudPrintProxyPolicyStartupTest, StartAndShutdown) { } ProfileKeyedService* CloudPrintProxyServiceFactoryForPolicyTest( - Profile* profile) { - CloudPrintProxyService* service = new CloudPrintProxyService(profile); + content::BrowserContext* profile) { + CloudPrintProxyService* service = + new CloudPrintProxyService(static_cast<Profile*>(profile)); service->Initialize(); return service; } diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.cc b/chrome/browser/profiles/gaia_info_update_service_factory.cc index f8f46f7..7631f06 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.cc +++ b/chrome/browser/profiles/gaia_info_update_service_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/profiles/gaia_info_update_service_factory.h" #include "chrome/browser/profiles/gaia_info_update_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/common/pref_names.h" #include "components/user_prefs/pref_registry_syncable.h" @@ -29,7 +30,8 @@ GAIAInfoUpdateServiceFactory* GAIAInfoUpdateServiceFactory::GetInstance() { } ProfileKeyedService* GAIAInfoUpdateServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); if (!GAIAInfoUpdateService::ShouldUseGAIAProfileInfo(profile)) return NULL; return new GAIAInfoUpdateService(profile); diff --git a/chrome/browser/profiles/gaia_info_update_service_factory.h b/chrome/browser/profiles/gaia_info_update_service_factory.h index 2eb611a..0851814 100644 --- a/chrome/browser/profiles/gaia_info_update_service_factory.h +++ b/chrome/browser/profiles/gaia_info_update_service_factory.h @@ -33,7 +33,7 @@ class GAIAInfoUpdateServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/profiles/profile_dependency_manager_unittest.cc b/chrome/browser/profiles/profile_dependency_manager_unittest.cc index 458ff86..1dab5fe 100644 --- a/chrome/browser/profiles/profile_dependency_manager_unittest.cc +++ b/chrome/browser/profiles/profile_dependency_manager_unittest.cc @@ -36,12 +36,12 @@ class TestService : public ProfileKeyedServiceFactory { } virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE { + content::BrowserContext* profile) const OVERRIDE { ADD_FAILURE() << "This isn't part of the tests!"; return NULL; } - virtual void ProfileShutdown(Profile* profile) OVERRIDE { + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE { fill_on_shutdown_->push_back(name_); } diff --git a/chrome/browser/profiles/profile_keyed_base_factory.cc b/chrome/browser/profiles/profile_keyed_base_factory.cc index 7f52e3d..daa24e2 100644 --- a/chrome/browser/profiles/profile_keyed_base_factory.cc +++ b/chrome/browser/profiles/profile_keyed_base_factory.cc @@ -8,6 +8,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "components/user_prefs/pref_registry_syncable.h" +#include "components/user_prefs/user_prefs.h" ProfileKeyedBaseFactory::ProfileKeyedBaseFactory( const char* name, ProfileDependencyManager* manager) @@ -27,9 +28,12 @@ void ProfileKeyedBaseFactory::DependsOn(ProfileKeyedBaseFactory* rhs) { dependency_manager_->AddEdge(rhs, this); } -Profile* ProfileKeyedBaseFactory::GetProfileToUse(Profile* profile) { +content::BrowserContext* ProfileKeyedBaseFactory::GetProfileToUse( + content::BrowserContext* context) { DCHECK(CalledOnValidThread()); + Profile* profile = static_cast<Profile*>(context); + #ifndef NDEBUG dependency_manager_->AssertProfileWasntDestroyed(profile); #endif @@ -52,7 +56,8 @@ Profile* ProfileKeyedBaseFactory::GetProfileToUse(Profile* profile) { return profile; } -void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(Profile* profile) { +void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile( + content::BrowserContext* profile) { // Safe timing for pref registration is hard. Previously, we made Profile // responsible for all pref registration on every service that used // Profile. Now we don't and there are timing issues. @@ -76,9 +81,10 @@ void ProfileKeyedBaseFactory::RegisterUserPrefsOnProfile(Profile* profile) { // parallel) and we don't want to register multiple times on the same profile. DCHECK(!profile->IsOffTheRecord()); - std::set<Profile*>::iterator it = registered_preferences_.find(profile); + std::set<content::BrowserContext*>::iterator it = + registered_preferences_.find(profile); if (it == registered_preferences_.end()) { - PrefService* prefs = profile->GetPrefs(); + PrefService* prefs = components::UserPrefs::Get(profile); PrefRegistrySyncable* registry = static_cast<PrefRegistrySyncable*>( prefs->DeprecatedGetPrefRegistry()); RegisterUserPrefs(registry); @@ -102,7 +108,8 @@ bool ProfileKeyedBaseFactory::ServiceIsNULLWhileTesting() const { return false; } -void ProfileKeyedBaseFactory::ProfileDestroyed(Profile* profile) { +void ProfileKeyedBaseFactory::ProfileDestroyed( + content::BrowserContext* profile) { // While object destruction can be customized in ways where the object is // only dereferenced, this still must run on the UI thread. DCHECK(CalledOnValidThread()); @@ -110,12 +117,14 @@ void ProfileKeyedBaseFactory::ProfileDestroyed(Profile* profile) { registered_preferences_.erase(profile); } -bool ProfileKeyedBaseFactory::ArePreferencesSetOn(Profile* profile) const { +bool ProfileKeyedBaseFactory::ArePreferencesSetOn( + content::BrowserContext* profile) const { return registered_preferences_.find(profile) != registered_preferences_.end(); } -void ProfileKeyedBaseFactory::MarkPreferencesSetOn(Profile* profile) { +void ProfileKeyedBaseFactory::MarkPreferencesSetOn( + content::BrowserContext* profile) { DCHECK(!ArePreferencesSetOn(profile)); registered_preferences_.insert(profile); } diff --git a/chrome/browser/profiles/profile_keyed_base_factory.h b/chrome/browser/profiles/profile_keyed_base_factory.h index 0b5ee1b..92401d0 100644 --- a/chrome/browser/profiles/profile_keyed_base_factory.h +++ b/chrome/browser/profiles/profile_keyed_base_factory.h @@ -10,11 +10,16 @@ #include "base/threading/non_thread_safe.h" #include "chrome/browser/profiles/dependency_node.h" +namespace content { +class BrowserContext; +}; + class PrefRegistrySyncable; class PrefService; -class Profile; class ProfileDependencyManager; +class Profile; + // Base class for Factories that take a Profile object and return some service. // // Unless you're trying to make a new type of Factory, you probably don't want @@ -29,7 +34,7 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe, // |profile|. This is the public interface and is safe to be called multiple // times because testing code can have multiple services of the same type // attached to a single |profile|. - void RegisterUserPrefsOnProfile(Profile* profile); + void RegisterUserPrefsOnProfile(content::BrowserContext* profile); #ifndef NDEBUG // Returns our name. We don't keep track of this in release mode. @@ -46,7 +51,7 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe, void DependsOn(ProfileKeyedBaseFactory* rhs); // Finds which profile (if any) to use using the Service.*Incognito methods. - Profile* GetProfileToUse(Profile* profile); + content::BrowserContext* GetProfileToUse(content::BrowserContext* profile); // Interface for people building a concrete FooServiceFactory: -------------- @@ -91,14 +96,14 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe, // should delete/deref/do other final memory management things during this // phase. You must also call the base class method as the last thing you // do. - virtual void ProfileShutdown(Profile* profile) = 0; - virtual void ProfileDestroyed(Profile* profile); + virtual void ProfileShutdown(content::BrowserContext* profile) = 0; + virtual void ProfileDestroyed(content::BrowserContext* profile); // Returns whether we've registered the preferences on this profile. - bool ArePreferencesSetOn(Profile* profile) const; + bool ArePreferencesSetOn(content::BrowserContext* profile) const; // Mark profile as Preferences set. - void MarkPreferencesSetOn(Profile* profile); + void MarkPreferencesSetOn(content::BrowserContext* profile); private: friend class ProfileDependencyManager; @@ -109,11 +114,11 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe, // Because of ServiceIsNULLWhileTesting(), we need a way to tell different // subclasses that they should disable testing. - virtual void SetEmptyTestingFactory(Profile* profile) = 0; + virtual void SetEmptyTestingFactory(content::BrowserContext* profile) = 0; // We also need a generalized, non-returning method that generates the object // now for when we're creating the profile. - virtual void CreateServiceNow(Profile* profile) = 0; + virtual void CreateServiceNow(content::BrowserContext* profile) = 0; // Which ProfileDependencyManager we should communicate with. In real code, // this will always be ProfileDependencyManager::GetInstance(), but unit @@ -121,7 +126,7 @@ class ProfileKeyedBaseFactory : public base::NonThreadSafe, ProfileDependencyManager* dependency_manager_; // Profiles that have this service's preferences registered on them. - std::set<Profile*> registered_preferences_; + std::set<content::BrowserContext*> registered_preferences_; #if !defined(NDEBUG) // A static string passed in to our constructor. Should be unique across all diff --git a/chrome/browser/profiles/profile_keyed_service_factory.cc b/chrome/browser/profiles/profile_keyed_service_factory.cc index d3ee4a5..dd74146 100644 --- a/chrome/browser/profiles/profile_keyed_service_factory.cc +++ b/chrome/browser/profiles/profile_keyed_service_factory.cc @@ -12,8 +12,8 @@ #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/profile_keyed_service.h" -void ProfileKeyedServiceFactory::SetTestingFactory(Profile* profile, - FactoryFunction factory) { +void ProfileKeyedServiceFactory::SetTestingFactory( + content::BrowserContext* profile, FactoryFunction factory) { // Destroying the profile may cause us to lose data about whether |profile| // has our preferences registered on it (since the profile object itself // isn't dead). See if we need to readd it once we've gone through normal @@ -33,7 +33,7 @@ void ProfileKeyedServiceFactory::SetTestingFactory(Profile* profile, } ProfileKeyedService* ProfileKeyedServiceFactory::SetTestingFactoryAndUse( - Profile* profile, + content::BrowserContext* profile, FactoryFunction factory) { DCHECK(factory); SetTestingFactory(profile, factory); @@ -50,7 +50,7 @@ ProfileKeyedServiceFactory::~ProfileKeyedServiceFactory() { } ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile( - Profile* profile, + content::BrowserContext* profile, bool create) { profile = GetProfileToUse(profile); if (!profile) @@ -85,19 +85,21 @@ ProfileKeyedService* ProfileKeyedServiceFactory::GetServiceForProfile( return service; } -void ProfileKeyedServiceFactory::Associate(Profile* profile, +void ProfileKeyedServiceFactory::Associate(content::BrowserContext* profile, ProfileKeyedService* service) { DCHECK(!ContainsKey(mapping_, profile)); mapping_.insert(std::make_pair(profile, service)); } -void ProfileKeyedServiceFactory::ProfileShutdown(Profile* profile) { +void ProfileKeyedServiceFactory::ProfileShutdown( + content::BrowserContext* profile) { ProfileKeyedServices::iterator it = mapping_.find(profile); if (it != mapping_.end() && it->second) it->second->Shutdown(); } -void ProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) { +void ProfileKeyedServiceFactory::ProfileDestroyed( + content::BrowserContext* profile) { ProfileKeyedServices::iterator it = mapping_.find(profile); if (it != mapping_.end()) { delete it->second; @@ -114,10 +116,11 @@ void ProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) { } void ProfileKeyedServiceFactory::SetEmptyTestingFactory( - Profile* profile) { + content::BrowserContext* profile) { SetTestingFactory(profile, NULL); } -void ProfileKeyedServiceFactory::CreateServiceNow(Profile* profile) { +void ProfileKeyedServiceFactory::CreateServiceNow( + content::BrowserContext* profile) { GetServiceForProfile(profile, true); } diff --git a/chrome/browser/profiles/profile_keyed_service_factory.h b/chrome/browser/profiles/profile_keyed_service_factory.h index 0cfa841..973ef6b 100644 --- a/chrome/browser/profiles/profile_keyed_service_factory.h +++ b/chrome/browser/profiles/profile_keyed_service_factory.h @@ -29,18 +29,20 @@ class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { // A function that supplies the instance of a ProfileKeyedService for a given // Profile. This is used primarily for testing, where we want to feed a // specific mock into the PKSF system. - typedef ProfileKeyedService* (*FactoryFunction)(Profile* profile); + typedef ProfileKeyedService* + (*FactoryFunction)(content::BrowserContext* profile); // Associates |factory| with |profile| so that |factory| is used to create // the ProfileKeyedService when requested. |factory| can be NULL to signal // that ProfileKeyedService should be NULL. Multiple calls to // SetTestingFactory() are allowed; previous services will be shut down. - void SetTestingFactory(Profile* profile, FactoryFunction factory); + void SetTestingFactory(content::BrowserContext* profile, + FactoryFunction factory); // Associates |factory| with |profile| and immediately returns the created // ProfileKeyedService. Since the factory will be used immediately, it may // not be NULL. - ProfileKeyedService* SetTestingFactoryAndUse(Profile* profile, + ProfileKeyedService* SetTestingFactoryAndUse(content::BrowserContext* profile, FactoryFunction factory); protected: @@ -63,15 +65,17 @@ class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { // through the GetProfileToUse() method on the base. If |create| is true, // the service will be created using BuildServiceInstanceFor() if it doesn't // already exist. - ProfileKeyedService* GetServiceForProfile(Profile* profile, bool create); + ProfileKeyedService* GetServiceForProfile(content::BrowserContext* profile, + bool create); // Maps |profile| to |service| with debug checks to prevent duplication. - void Associate(Profile* profile, ProfileKeyedService* service); + void Associate(content::BrowserContext* profile, + ProfileKeyedService* service); // All subclasses of ProfileKeyedServiceFactory must return a // ProfileKeyedService instead of just a ProfileKeyedBase. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const = 0; + content::BrowserContext* profile) const = 0; // A helper object actually listens for notifications about Profile // destruction, calculates the order in which things are destroyed and then @@ -84,24 +88,27 @@ class ProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { // // Secondly, ProfileDestroyed() is called on every ServiceFactory and the // default implementation removes it from |mapping_| and deletes the pointer. - virtual void ProfileShutdown(Profile* profile) OVERRIDE; - virtual void ProfileDestroyed(Profile* profile) OVERRIDE; + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; - virtual void SetEmptyTestingFactory(Profile* profile) OVERRIDE; - virtual void CreateServiceNow(Profile* profile) OVERRIDE; + virtual void SetEmptyTestingFactory( + content::BrowserContext* profile) OVERRIDE; + virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; private: friend class ProfileDependencyManager; friend class ProfileDependencyManagerUnittests; - typedef std::map<Profile*, ProfileKeyedService*> ProfileKeyedServices; - typedef std::map<Profile*, FactoryFunction> ProfileOverriddenFunctions; + typedef std::map<content::BrowserContext*, ProfileKeyedService*> + ProfileKeyedServices; + typedef std::map<content::BrowserContext*, FactoryFunction> + ProfileOverriddenFunctions; // The mapping between a Profile and its service. - std::map<Profile*, ProfileKeyedService*> mapping_; + std::map<content::BrowserContext*, ProfileKeyedService*> mapping_; // The mapping between a Profile and its overridden FactoryFunction. - std::map<Profile*, FactoryFunction> factories_; + std::map<content::BrowserContext*, FactoryFunction> factories_; DISALLOW_COPY_AND_ASSIGN(ProfileKeyedServiceFactory); }; diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc index ad29ec2..b9920bc 100644 --- a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc +++ b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.cc @@ -11,7 +11,7 @@ #include "chrome/browser/profiles/refcounted_profile_keyed_service.h" void RefcountedProfileKeyedServiceFactory::SetTestingFactory( - Profile* profile, + content::BrowserContext* profile, FactoryFunction factory) { // Destroying the profile may cause us to lose data about whether |profile| // has our preferences registered on it (since the profile object itself @@ -33,7 +33,7 @@ void RefcountedProfileKeyedServiceFactory::SetTestingFactory( scoped_refptr<RefcountedProfileKeyedService> RefcountedProfileKeyedServiceFactory::SetTestingFactoryAndUse( - Profile* profile, + content::BrowserContext* profile, FactoryFunction factory) { DCHECK(factory); SetTestingFactory(profile, factory); @@ -52,7 +52,7 @@ RefcountedProfileKeyedServiceFactory::~RefcountedProfileKeyedServiceFactory() { scoped_refptr<RefcountedProfileKeyedService> RefcountedProfileKeyedServiceFactory::GetServiceForProfile( - Profile* profile, + content::BrowserContext* profile, bool create) { profile = GetProfileToUse(profile); if (!profile) @@ -88,19 +88,21 @@ RefcountedProfileKeyedServiceFactory::GetServiceForProfile( } void RefcountedProfileKeyedServiceFactory::Associate( - Profile* profile, + content::BrowserContext* profile, const scoped_refptr<RefcountedProfileKeyedService>& service) { DCHECK(!ContainsKey(mapping_, profile)); mapping_.insert(std::make_pair(profile, service)); } -void RefcountedProfileKeyedServiceFactory::ProfileShutdown(Profile* profile) { +void RefcountedProfileKeyedServiceFactory::ProfileShutdown( + content::BrowserContext* profile) { RefCountedStorage::iterator it = mapping_.find(profile); if (it != mapping_.end() && it->second) it->second->ShutdownOnUIThread(); } -void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) { +void RefcountedProfileKeyedServiceFactory::ProfileDestroyed( + content::BrowserContext* profile) { // We "merely" drop our reference to the service. Hopefully this will cause // the service to be destroyed. If not, oh well. mapping_.erase(profile); @@ -115,10 +117,11 @@ void RefcountedProfileKeyedServiceFactory::ProfileDestroyed(Profile* profile) { } void RefcountedProfileKeyedServiceFactory::SetEmptyTestingFactory( - Profile* profile) { + content::BrowserContext* profile) { SetTestingFactory(profile, NULL); } -void RefcountedProfileKeyedServiceFactory::CreateServiceNow(Profile* profile) { +void RefcountedProfileKeyedServiceFactory::CreateServiceNow( + content::BrowserContext* profile) { GetServiceForProfile(profile, true); } diff --git a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h index 0430d9b..07be306 100644 --- a/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h +++ b/chrome/browser/profiles/refcounted_profile_keyed_service_factory.h @@ -29,19 +29,20 @@ class RefcountedProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { // Profile. This is used primarily for testing, where we want to feed a // specific mock into the PKSF system. typedef scoped_refptr<RefcountedProfileKeyedService> - (*FactoryFunction)(Profile* profile); + (*FactoryFunction)(content::BrowserContext* profile); // Associates |factory| with |profile| so that |factory| is used to create // the ProfileKeyedService when requested. |factory| can be NULL to signal // that ProfileKeyedService should be NULL. Multiple calls to // SetTestingFactory() are allowed; previous services will be shut down. - void SetTestingFactory(Profile* profile, FactoryFunction factory); + void SetTestingFactory(content::BrowserContext* profile, + FactoryFunction factory); // Associates |factory| with |profile| and immediately returns the created // ProfileKeyedService. Since the factory will be used immediately, it may // not be NULL. scoped_refptr<RefcountedProfileKeyedService> SetTestingFactoryAndUse( - Profile* profile, + content::BrowserContext* profile, FactoryFunction factory); protected: @@ -50,27 +51,30 @@ class RefcountedProfileKeyedServiceFactory : public ProfileKeyedBaseFactory { virtual ~RefcountedProfileKeyedServiceFactory(); scoped_refptr<RefcountedProfileKeyedService> GetServiceForProfile( - Profile* profile, + content::BrowserContext* profile, bool create); // Maps |profile| to |service| with debug checks to prevent duplication. - void Associate(Profile* profile, + void Associate(content::BrowserContext* profile, const scoped_refptr<RefcountedProfileKeyedService>& service); // All subclasses of RefcountedProfileKeyedServiceFactory must return a // RefcountedProfileKeyedService instead of just a ProfileKeyedBase. virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const = 0; + content::BrowserContext* profile) const = 0; - virtual void ProfileShutdown(Profile* profile) OVERRIDE; - virtual void ProfileDestroyed(Profile* profile) OVERRIDE; - virtual void SetEmptyTestingFactory(Profile* profile) OVERRIDE; - virtual void CreateServiceNow(Profile* profile) OVERRIDE; + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; + virtual void SetEmptyTestingFactory( + content::BrowserContext* profile) OVERRIDE; + virtual void CreateServiceNow(content::BrowserContext* profile) OVERRIDE; private: - typedef std::map<Profile*, scoped_refptr<RefcountedProfileKeyedService> > + typedef std::map<content::BrowserContext*, + scoped_refptr<RefcountedProfileKeyedService> > RefCountedStorage; - typedef std::map<Profile*, FactoryFunction> ProfileOverriddenFunctions; + typedef std::map<content::BrowserContext*, + FactoryFunction> ProfileOverriddenFunctions; // The mapping between a Profile and its refcounted service. RefCountedStorage mapping_; diff --git a/chrome/browser/profiles/startup_task_runner_service_factory.cc b/chrome/browser/profiles/startup_task_runner_service_factory.cc index eaff6a8..00ef076 100644 --- a/chrome/browser/profiles/startup_task_runner_service_factory.cc +++ b/chrome/browser/profiles/startup_task_runner_service_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/profiles/startup_task_runner_service_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/profiles/startup_task_runner_service.h" @@ -28,6 +29,6 @@ StartupTaskRunnerServiceFactory* } ProfileKeyedService* StartupTaskRunnerServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new StartupTaskRunnerService(profile); + content::BrowserContext* profile) const { + return new StartupTaskRunnerService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/profiles/startup_task_runner_service_factory.h b/chrome/browser/profiles/startup_task_runner_service_factory.h index 58bb4db..5811154 100644 --- a/chrome/browser/profiles/startup_task_runner_service_factory.h +++ b/chrome/browser/profiles/startup_task_runner_service_factory.h @@ -31,7 +31,7 @@ class StartupTaskRunnerServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(StartupTaskRunnerServiceFactory); }; diff --git a/chrome/browser/search/instant_service_factory.cc b/chrome/browser/search/instant_service_factory.cc index ebb68a9..513fbc9 100644 --- a/chrome/browser/search/instant_service_factory.cc +++ b/chrome/browser/search/instant_service_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/search/instant_service_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search/instant_service.h" @@ -32,6 +33,6 @@ bool InstantServiceFactory::ServiceHasOwnInstanceInIncognito() const { } ProfileKeyedService* InstantServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new InstantService(profile); + content::BrowserContext* profile) const { + return new InstantService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/search/instant_service_factory.h b/chrome/browser/search/instant_service_factory.h index ad02cdf..6721314 100644 --- a/chrome/browser/search/instant_service_factory.h +++ b/chrome/browser/search/instant_service_factory.h @@ -31,7 +31,7 @@ class InstantServiceFactory : public ProfileKeyedServiceFactory { // Overridden from ProfileKeyedServiceFactory: virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(InstantServiceFactory); }; diff --git a/chrome/browser/search_engines/template_url_fetcher_factory.cc b/chrome/browser/search_engines/template_url_fetcher_factory.cc index 80113bd..4543a14 100644 --- a/chrome/browser/search_engines/template_url_fetcher_factory.cc +++ b/chrome/browser/search_engines/template_url_fetcher_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/search_engines/template_url_fetcher_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/search_engines/template_url_fetcher.h" #include "chrome/browser/search_engines/template_url_service_factory.h" @@ -37,8 +38,8 @@ TemplateURLFetcherFactory::~TemplateURLFetcherFactory() { } ProfileKeyedService* TemplateURLFetcherFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new TemplateURLFetcher(profile); + content::BrowserContext* profile) const { + return new TemplateURLFetcher(static_cast<Profile*>(profile)); } bool TemplateURLFetcherFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/search_engines/template_url_fetcher_factory.h b/chrome/browser/search_engines/template_url_fetcher_factory.h index b98e298..0e72a86 100644 --- a/chrome/browser/search_engines/template_url_fetcher_factory.h +++ b/chrome/browser/search_engines/template_url_fetcher_factory.h @@ -32,7 +32,7 @@ class TemplateURLFetcherFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TemplateURLFetcherFactory); diff --git a/chrome/browser/search_engines/template_url_service_factory.cc b/chrome/browser/search_engines/template_url_service_factory.cc index 561fefb..bc6fb3f2 100644 --- a/chrome/browser/search_engines/template_url_service_factory.cc +++ b/chrome/browser/search_engines/template_url_service_factory.cc @@ -26,8 +26,8 @@ TemplateURLServiceFactory* TemplateURLServiceFactory::GetInstance() { // static ProfileKeyedService* TemplateURLServiceFactory::BuildInstanceFor( - Profile* profile) { - return new TemplateURLService(profile); + content::BrowserContext* profile) { + return new TemplateURLService(static_cast<Profile*>(profile)); } TemplateURLServiceFactory::TemplateURLServiceFactory() @@ -41,8 +41,8 @@ TemplateURLServiceFactory::TemplateURLServiceFactory() TemplateURLServiceFactory::~TemplateURLServiceFactory() {} ProfileKeyedService* TemplateURLServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return BuildInstanceFor(profile); + content::BrowserContext* profile) const { + return BuildInstanceFor(static_cast<Profile*>(profile)); } void TemplateURLServiceFactory::RegisterUserPrefs( @@ -96,7 +96,8 @@ bool TemplateURLServiceFactory::ServiceIsNULLWhileTesting() const { return true; } -void TemplateURLServiceFactory::ProfileShutdown(Profile* profile) { +void TemplateURLServiceFactory::ProfileShutdown( + content::BrowserContext* profile) { // We shutdown AND destroy the TemplateURLService during this pass. // TemplateURLService schedules a task on the WebDataService from its // destructor. Delete it first to ensure the task gets scheduled before we @@ -105,6 +106,7 @@ void TemplateURLServiceFactory::ProfileShutdown(Profile* profile) { ProfileKeyedServiceFactory::ProfileDestroyed(profile); } -void TemplateURLServiceFactory::ProfileDestroyed(Profile* profile) { +void TemplateURLServiceFactory::ProfileDestroyed( + content::BrowserContext* profile) { // Don't double delete. } diff --git a/chrome/browser/search_engines/template_url_service_factory.h b/chrome/browser/search_engines/template_url_service_factory.h index 13bd98b..f4bbb7e 100644 --- a/chrome/browser/search_engines/template_url_service_factory.h +++ b/chrome/browser/search_engines/template_url_service_factory.h @@ -20,7 +20,8 @@ class TemplateURLServiceFactory : public ProfileKeyedServiceFactory { static TemplateURLServiceFactory* GetInstance(); - static ProfileKeyedService* BuildInstanceFor(Profile* profile); + static ProfileKeyedService* BuildInstanceFor( + content::BrowserContext* profile); private: friend struct DefaultSingletonTraits<TemplateURLServiceFactory>; @@ -30,12 +31,12 @@ class TemplateURLServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; - virtual void ProfileShutdown(Profile* profile) OVERRIDE; - virtual void ProfileDestroyed(Profile* profile) OVERRIDE; + virtual void ProfileShutdown(content::BrowserContext* profile) OVERRIDE; + virtual void ProfileDestroyed(content::BrowserContext* profile) OVERRIDE; }; #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_FACTORY_H_ diff --git a/chrome/browser/search_engines/template_url_service_test_util.cc b/chrome/browser/search_engines/template_url_service_test_util.cc index 10009c6..e464e43 100644 --- a/chrome/browser/search_engines/template_url_service_test_util.cc +++ b/chrome/browser/search_engines/template_url_service_test_util.cc @@ -56,8 +56,8 @@ static void WaitForThreadToProcessRequests(BrowserThread::ID identifier) { // SetKeywordSearchTermsForURL. class TestingTemplateURLService : public TemplateURLService { public: - static ProfileKeyedService* Build(Profile* profile) { - return new TestingTemplateURLService(profile); + static ProfileKeyedService* Build(content::BrowserContext* profile) { + return new TestingTemplateURLService(static_cast<Profile*>(profile)); } explicit TestingTemplateURLService(Profile* profile) diff --git a/chrome/browser/sessions/in_memory_tab_restore_service.cc b/chrome/browser/sessions/in_memory_tab_restore_service.cc index c7f81f2..89caa2e 100644 --- a/chrome/browser/sessions/in_memory_tab_restore_service.cc +++ b/chrome/browser/sessions/in_memory_tab_restore_service.cc @@ -5,6 +5,7 @@ #include "chrome/browser/sessions/in_memory_tab_restore_service.h" #include "base/compiler_specific.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/tab_restore_service_factory.h" InMemoryTabRestoreService::InMemoryTabRestoreService( @@ -87,6 +88,6 @@ void InMemoryTabRestoreService::Shutdown() { } ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new InMemoryTabRestoreService(profile, NULL); + content::BrowserContext* profile) const { + return new InMemoryTabRestoreService(static_cast<Profile*>(profile), NULL); } diff --git a/chrome/browser/sessions/persistent_tab_restore_service.cc b/chrome/browser/sessions/persistent_tab_restore_service.cc index 9e7e801..7476086 100644 --- a/chrome/browser/sessions/persistent_tab_restore_service.cc +++ b/chrome/browser/sessions/persistent_tab_restore_service.cc @@ -975,6 +975,6 @@ void PersistentTabRestoreService::PruneEntries() { } ProfileKeyedService* TabRestoreServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new PersistentTabRestoreService(profile, NULL); + content::BrowserContext* profile) const { + return new PersistentTabRestoreService(static_cast<Profile*>(profile), NULL); } diff --git a/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc b/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc index 1c6675c..a4b91e4 100644 --- a/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc +++ b/chrome/browser/sessions/persistent_tab_restore_service_browsertest.cc @@ -7,6 +7,7 @@ #include "base/compiler_specific.h" #include "base/stringprintf.h" #include "base/utf_string_conversions.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sessions/session_service_factory.h" #include "chrome/browser/sessions/session_types.h" diff --git a/chrome/browser/sessions/session_service_factory.cc b/chrome/browser/sessions/session_service_factory.cc index 7c27170..938420a 100644 --- a/chrome/browser/sessions/session_service_factory.cc +++ b/chrome/browser/sessions/session_service_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/sessions/session_service_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sessions/session_service.h" @@ -58,9 +59,9 @@ SessionServiceFactory::~SessionServiceFactory() { } ProfileKeyedService* SessionServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { SessionService* service = NULL; - service = new SessionService(profile); + service = new SessionService(static_cast<Profile*>(profile)); service->ResetFromCurrentBrowsers(); return service; } diff --git a/chrome/browser/sessions/session_service_factory.h b/chrome/browser/sessions/session_service_factory.h index 3a4fde8..3500bc7 100644 --- a/chrome/browser/sessions/session_service_factory.h +++ b/chrome/browser/sessions/session_service_factory.h @@ -56,7 +56,7 @@ class SessionServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/sessions/tab_restore_service_factory.cc b/chrome/browser/sessions/tab_restore_service_factory.cc index a0ad156..c4eba06 100644 --- a/chrome/browser/sessions/tab_restore_service_factory.cc +++ b/chrome/browser/sessions/tab_restore_service_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/sessions/tab_restore_service_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sessions/tab_restore_service.h" diff --git a/chrome/browser/sessions/tab_restore_service_factory.h b/chrome/browser/sessions/tab_restore_service_factory.h index be90f8e..f9e513e 100644 --- a/chrome/browser/sessions/tab_restore_service_factory.h +++ b/chrome/browser/sessions/tab_restore_service_factory.h @@ -34,7 +34,7 @@ class TabRestoreServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/signin/about_signin_internals_factory.cc b/chrome/browser/signin/about_signin_internals_factory.cc index f5f197f..21a0922 100644 --- a/chrome/browser/signin/about_signin_internals_factory.cc +++ b/chrome/browser/signin/about_signin_internals_factory.cc @@ -72,8 +72,8 @@ void AboutSigninInternalsFactory::RegisterUserPrefs( } ProfileKeyedService* AboutSigninInternalsFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { AboutSigninInternals* service = new AboutSigninInternals(); - service->Initialize(profile); + service->Initialize(static_cast<Profile*>(profile)); return service; } diff --git a/chrome/browser/signin/about_signin_internals_factory.h b/chrome/browser/signin/about_signin_internals_factory.h index c3f0a58..ab2cc41 100644 --- a/chrome/browser/signin/about_signin_internals_factory.h +++ b/chrome/browser/signin/about_signin_internals_factory.h @@ -34,7 +34,7 @@ class AboutSigninInternalsFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; #endif // CHROME_BROWSER_SIGNIN_ABOUT_SIGNIN_INTERNALS_FACTORY_H_ diff --git a/chrome/browser/signin/fake_signin_manager.cc b/chrome/browser/signin/fake_signin_manager.cc index b8296721..c313a12 100644 --- a/chrome/browser/signin/fake_signin_manager.cc +++ b/chrome/browser/signin/fake_signin_manager.cc @@ -41,8 +41,9 @@ void FakeSigninManagerBase::SignOut() { } // static -ProfileKeyedService* FakeSigninManagerBase::Build(Profile* profile) { - return new FakeSigninManagerBase(profile); +ProfileKeyedService* FakeSigninManagerBase::Build( + content::BrowserContext* profile) { + return new FakeSigninManagerBase(static_cast<Profile*>(profile)); } #if !defined (OS_CHROMEOS) @@ -82,8 +83,9 @@ void FakeSigninManager::SignOut() { } // static -ProfileKeyedService* FakeSigninManager::Build(Profile* profile) { - return new FakeSigninManager(profile); +ProfileKeyedService* FakeSigninManager::Build( + content::BrowserContext* profile) { + return new FakeSigninManager(static_cast<Profile*>(profile)); } #endif // !defined (OS_CHROMEOS) diff --git a/chrome/browser/signin/fake_signin_manager.h b/chrome/browser/signin/fake_signin_manager.h index 31d06a0..2fc6dbe 100644 --- a/chrome/browser/signin/fake_signin_manager.h +++ b/chrome/browser/signin/fake_signin_manager.h @@ -21,7 +21,7 @@ class FakeSigninManagerBase : public SigninManagerBase { virtual void SignOut() OVERRIDE; // Helper function to be used with ProfileKeyedService::SetTestingFactory(). - static ProfileKeyedService* Build(Profile* profile); + static ProfileKeyedService* Build(content::BrowserContext* profile); }; #if !defined(OS_CHROMEOS) @@ -49,7 +49,7 @@ class FakeSigninManager : public SigninManager { const std::string& password) OVERRIDE; // Helper function to be used with ProfileKeyedService::SetTestingFactory(). - static ProfileKeyedService* Build(Profile* profile); + static ProfileKeyedService* Build(content::BrowserContext* profile); }; #endif // !defined (OS_CHROMEOS) diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc index f9fb647..8f1723c 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc @@ -38,7 +38,8 @@ ProfileOAuth2TokenServiceFactory* } ProfileKeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); ProfileOAuth2TokenService* service; #if defined(OS_ANDROID) service = new AndroidProfileOAuth2TokenService(profile->GetRequestContext()); diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.h b/chrome/browser/signin/profile_oauth2_token_service_factory.h index a63e6db..1d350df 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_factory.h +++ b/chrome/browser/signin/profile_oauth2_token_service_factory.h @@ -34,7 +34,7 @@ class ProfileOAuth2TokenServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory implementation. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ProfileOAuth2TokenServiceFactory); }; diff --git a/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc b/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc index 184c7b2..971d66c 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc @@ -157,7 +157,8 @@ scoped_ptr<OAuth2TokenService::Request> return request.PassAs<OAuth2TokenService::Request>(); } -static ProfileKeyedService* CreateOAuth2TokenService(Profile* profile) { +static ProfileKeyedService* CreateOAuth2TokenService( + content::BrowserContext* profile) { return new MockProfileOAuth2TokenService(); } diff --git a/chrome/browser/signin/signin_manager_factory.cc b/chrome/browser/signin/signin_manager_factory.cc index b7b3052..dec9725 100644 --- a/chrome/browser/signin/signin_manager_factory.cc +++ b/chrome/browser/signin/signin_manager_factory.cc @@ -78,15 +78,13 @@ void SigninManagerFactory::RegisterPrefs(PrefRegistrySimple* registry) { } ProfileKeyedService* SigninManagerFactory::BuildServiceInstanceFor( - Profile* profile) const { - + content::BrowserContext* profile) const { SigninManagerBase* service = NULL; #if defined(OS_CHROMEOS) service = new SigninManagerBase(); #else service = new SigninManager(); #endif - - service->Initialize(profile); + service->Initialize(static_cast<Profile*>(profile)); return service; } diff --git a/chrome/browser/signin/signin_manager_factory.h b/chrome/browser/signin/signin_manager_factory.h index 4df297f..c62a8d6 100644 --- a/chrome/browser/signin/signin_manager_factory.h +++ b/chrome/browser/signin/signin_manager_factory.h @@ -54,7 +54,7 @@ class SigninManagerFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; #endif // CHROME_BROWSER_SIGNIN_SIGNIN_MANAGER_FACTORY_H_ diff --git a/chrome/browser/signin/signin_tracker_unittest.cc b/chrome/browser/signin/signin_tracker_unittest.cc index 8510a43..ec29a52 100644 --- a/chrome/browser/signin/signin_tracker_unittest.cc +++ b/chrome/browser/signin/signin_tracker_unittest.cc @@ -40,7 +40,7 @@ class MockTokenService : public TokenService { MOCK_CONST_METHOD1(HasTokenForService, bool(const char*)); }; -ProfileKeyedService* BuildMockTokenService(Profile* profile) { +ProfileKeyedService* BuildMockTokenService(content::BrowserContext* profile) { return new MockTokenService; } diff --git a/chrome/browser/signin/token_service_factory.cc b/chrome/browser/signin/token_service_factory.cc index bbf4b86..d9645c2 100644 --- a/chrome/browser/signin/token_service_factory.cc +++ b/chrome/browser/signin/token_service_factory.cc @@ -28,6 +28,6 @@ TokenServiceFactory* TokenServiceFactory::GetInstance() { } ProfileKeyedService* TokenServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new TokenService(); } diff --git a/chrome/browser/signin/token_service_factory.h b/chrome/browser/signin/token_service_factory.h index f4a42b5..6b6a338 100644 --- a/chrome/browser/signin/token_service_factory.h +++ b/chrome/browser/signin/token_service_factory.h @@ -32,7 +32,7 @@ class TokenServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(TokenServiceFactory); }; diff --git a/chrome/browser/speech/chrome_speech_recognition_preferences.cc b/chrome/browser/speech/chrome_speech_recognition_preferences.cc index 839fb23..3b3fcc7 100644 --- a/chrome/browser/speech/chrome_speech_recognition_preferences.cc +++ b/chrome/browser/speech/chrome_speech_recognition_preferences.cc @@ -60,9 +60,10 @@ ChromeSpeechRecognitionPreferences::Factory::~Factory() { ProfileKeyedService* ChromeSpeechRecognitionPreferences::Factory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { DCHECK(profile); - return new ChromeSpeechRecognitionPreferences::Service(profile); + return new ChromeSpeechRecognitionPreferences::Service( + static_cast<Profile*>(profile)); } void ChromeSpeechRecognitionPreferences::Factory::RegisterUserPrefs( diff --git a/chrome/browser/speech/chrome_speech_recognition_preferences.h b/chrome/browser/speech/chrome_speech_recognition_preferences.h index 30481c9..1d7dcde 100644 --- a/chrome/browser/speech/chrome_speech_recognition_preferences.h +++ b/chrome/browser/speech/chrome_speech_recognition_preferences.h @@ -69,8 +69,8 @@ class ChromeSpeechRecognitionPreferences virtual ~Factory(); // ProfileKeyedServiceFactory methods: - virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) - const OVERRIDE; + virtual ProfileKeyedService* BuildServiceInstanceFor( + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/speech/tts_extension_loader_chromeos.cc b/chrome/browser/speech/tts_extension_loader_chromeos.cc index 2195a72..6f7e3ae 100644 --- a/chrome/browser/speech/tts_extension_loader_chromeos.cc +++ b/chrome/browser/speech/tts_extension_loader_chromeos.cc @@ -47,9 +47,9 @@ class TtsExtensionLoaderChromeOsFactory : public ProfileKeyedServiceFactory { return true; } - virtual ProfileKeyedService* BuildServiceInstanceFor(Profile* profile) const - OVERRIDE { - return new TtsExtensionLoaderChromeOs(profile); + virtual ProfileKeyedService* BuildServiceInstanceFor( + content::BrowserContext* profile) const OVERRIDE { + return new TtsExtensionLoaderChromeOs(static_cast<Profile*>(profile)); } }; diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index 02a7655..b9b9ce4 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc @@ -53,8 +53,9 @@ syncer::SyncDataList GetAllSyncDataNoLimit( } // namespace -static ProfileKeyedService* BuildSpellcheckService(Profile* profile) { - return new SpellcheckService(profile); +static ProfileKeyedService* BuildSpellcheckService( + content::BrowserContext* profile) { + return new SpellcheckService(static_cast<Profile*>(profile)); } class SpellcheckCustomDictionaryTest : public testing::Test { diff --git a/chrome/browser/spellchecker/spellcheck_factory.cc b/chrome/browser/spellchecker/spellcheck_factory.cc index c859897..db224f5 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.cc +++ b/chrome/browser/spellchecker/spellcheck_factory.cc @@ -34,7 +34,9 @@ SpellcheckServiceFactory::SpellcheckServiceFactory() SpellcheckServiceFactory::~SpellcheckServiceFactory() {} ProfileKeyedService* SpellcheckServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + // Many variables are initialized from the profile in the SpellcheckService. DCHECK(profile); SpellcheckService* spellcheck = new SpellcheckService(profile); diff --git a/chrome/browser/spellchecker/spellcheck_factory.h b/chrome/browser/spellchecker/spellcheck_factory.h index b4cf9cc5..a831b87 100644 --- a/chrome/browser/spellchecker/spellcheck_factory.h +++ b/chrome/browser/spellchecker/spellcheck_factory.h @@ -30,7 +30,7 @@ class SpellcheckServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc index 603d023..b03bbb6 100644 --- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc @@ -18,8 +18,9 @@ using content::BrowserThread; using chrome::spellcheck_common::WordList; -static ProfileKeyedService* BuildSpellcheckService(Profile* profile) { - return new SpellcheckService(profile); +static ProfileKeyedService* BuildSpellcheckService( + content::BrowserContext* profile) { + return new SpellcheckService(static_cast<Profile*>(profile)); } class SpellcheckServiceTest : public testing::Test { diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc index bac79ef..894c389 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.cc +++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc @@ -74,7 +74,7 @@ bool AbstractProfileSyncServiceTest::CreateRoot(ModelType model_type) { // static ProfileKeyedService* AbstractProfileSyncServiceTest::BuildTokenService( - Profile* profile) { + content::BrowserContext* profile) { return new TokenService; } diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h index 555b197..19ba842 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.h +++ b/chrome/browser/sync/abstract_profile_sync_service_test.h @@ -48,7 +48,9 @@ class AbstractProfileSyncServiceTest : public testing::Test { bool CreateRoot(syncer::ModelType model_type); - static ProfileKeyedService* BuildTokenService(Profile* profile); + static ProfileKeyedService* BuildTokenService( + content::BrowserContext* profile); + protected: MessageLoopForUI ui_loop_; content::TestBrowserThread ui_thread_; diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc index 9700e10..ab80511 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -112,7 +112,7 @@ class FakeWebDataService : public AutofillWebDataService { class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper { public: - static ProfileKeyedService* Build(Profile* profile) { + static ProfileKeyedService* Build(content::BrowserContext* profile) { return new MockWebDataServiceWrapperSyncable(); } diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc index 3f3e27b..04f4cff 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -54,18 +54,20 @@ class HistoryMock : public HistoryService { virtual ~HistoryMock() {} }; -ProfileKeyedService* BuildBookmarkModel(Profile* profile) { +ProfileKeyedService* BuildBookmarkModel(content::BrowserContext* context) { + Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); bookmark_model->Load(profile->GetIOTaskRunner()); return bookmark_model; } -ProfileKeyedService* BuildBookmarkModelWithoutLoading(Profile* profile) { - return new BookmarkModel(profile); +ProfileKeyedService* BuildBookmarkModelWithoutLoading( + content::BrowserContext* profile) { + return new BookmarkModel(static_cast<Profile*>(profile)); } -ProfileKeyedService* BuildHistoryService(Profile* profile) { - return new HistoryMock(profile); +ProfileKeyedService* BuildHistoryService(content::BrowserContext* profile) { + return new HistoryMock(static_cast<Profile*>(profile)); } } // namespace diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index 232635f..61a069b 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -294,7 +294,8 @@ class WebDataServiceFake : public AutofillWebDataService { DISALLOW_COPY_AND_ASSIGN(WebDataServiceFake); }; -ProfileKeyedService* BuildMockWebDataServiceWrapper(Profile* profile) { +ProfileKeyedService* BuildMockWebDataServiceWrapper( + content::BrowserContext* profile) { return new MockWebDataServiceWrapper( new TokenWebDataServiceFake(), new WebDataServiceFake()); @@ -406,7 +407,7 @@ class MockPersonalDataManager : public PersonalDataManager { class MockPersonalDataManagerService : public autofill::PersonalDataManagerService { public: - static ProfileKeyedService* Build(Profile* profile) { + static ProfileKeyedService* Build(content::BrowserContext* profile) { return new MockPersonalDataManagerService(); } diff --git a/chrome/browser/sync/profile_sync_service_factory.cc b/chrome/browser/sync/profile_sync_service_factory.cc index c6fa790..38fb2ea 100644 --- a/chrome/browser/sync/profile_sync_service_factory.cc +++ b/chrome/browser/sync/profile_sync_service_factory.cc @@ -80,7 +80,9 @@ ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { } ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + ProfileSyncService::StartBehavior behavior = browser_defaults::kSyncAutoStarts ? ProfileSyncService::AUTO_START : ProfileSyncService::MANUAL_START; diff --git a/chrome/browser/sync/profile_sync_service_factory.h b/chrome/browser/sync/profile_sync_service_factory.h index b474611..f8550b5 100644 --- a/chrome/browser/sync/profile_sync_service_factory.h +++ b/chrome/browser/sync/profile_sync_service_factory.h @@ -27,7 +27,7 @@ class ProfileSyncServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; }; #endif // CHROME_BROWSER_SYNC_PROFILE_SYNC_SERVICE_FACTORY_H_ diff --git a/chrome/browser/sync/profile_sync_service_mock.cc b/chrome/browser/sync/profile_sync_service_mock.cc index ce20e93..48f561f 100644 --- a/chrome/browser/sync/profile_sync_service_mock.cc +++ b/chrome/browser/sync/profile_sync_service_mock.cc @@ -36,6 +36,6 @@ TestingProfile* ProfileSyncServiceMock::MakeSignedInTestingProfile() { // static ProfileKeyedService* ProfileSyncServiceMock::BuildMockProfileSyncService( - Profile* profile) { - return new ProfileSyncServiceMock(profile); + content::BrowserContext* profile) { + return new ProfileSyncServiceMock(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/sync/profile_sync_service_mock.h b/chrome/browser/sync/profile_sync_service_mock.h index 3bc60dc..bc42b7e 100644 --- a/chrome/browser/sync/profile_sync_service_mock.h +++ b/chrome/browser/sync/profile_sync_service_mock.h @@ -31,7 +31,8 @@ class ProfileSyncServiceMock : public ProfileSyncService { // Helper routine to be used in conjunction with // ProfileKeyedServiceFactory::SetTestingFactory(). - static ProfileKeyedService* BuildMockProfileSyncService(Profile* profile); + static ProfileKeyedService* BuildMockProfileSyncService( + content::BrowserContext* profile); MOCK_METHOD0(DisableForUser, void()); MOCK_METHOD3(OnBackendInitialized, diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index e7cd303..59c7fce 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -85,7 +85,8 @@ class NullPasswordStore : public MockPasswordStore { public: NullPasswordStore() {} - static scoped_refptr<RefcountedProfileKeyedService> Build(Profile* profile) { + static scoped_refptr<RefcountedProfileKeyedService> Build( + content::BrowserContext* profile) { return scoped_refptr<RefcountedProfileKeyedService>(); } @@ -128,7 +129,8 @@ class PasswordTestProfileSyncService : public TestProfileSyncService { QuitMessageLoop(); } - static ProfileKeyedService* Build(Profile* profile) { + static ProfileKeyedService* Build(content::BrowserContext* context) { + Profile* profile = static_cast<Profile*>(context); SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); ProfileSyncComponentsFactoryMock* factory = diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index f6b3353..6b3b6f5f 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -112,14 +112,14 @@ class ProfileSyncServiceStartupTest : public testing::Test { content::Details<const GoogleServiceSigninSuccessDetails>(&details)); } - static ProfileKeyedService* BuildService(Profile* profile) { + static ProfileKeyedService* BuildService(content::BrowserContext* profile) { SigninManagerBase* signin = static_cast<SigninManagerBase*>( SigninManagerFactory::GetInstance()->SetTestingFactoryAndUse( profile, FakeSigninManagerBase::Build)); signin->SetAuthenticatedUsername("test_user"); return new TestProfileSyncService( new ProfileSyncComponentsFactoryMock(), - profile, + static_cast<Profile*>(profile), signin, ProfileSyncService::MANUAL_START, true); @@ -153,17 +153,19 @@ class ProfileSyncServiceStartupTest : public testing::Test { class ProfileSyncServiceStartupCrosTest : public ProfileSyncServiceStartupTest { public: - static ProfileKeyedService* BuildCrosService(Profile* profile) { - SigninManagerBase* signin = - SigninManagerFactory::GetForProfile(profile); - signin->SetAuthenticatedUsername("test_user"); - return new TestProfileSyncService( - new ProfileSyncComponentsFactoryMock(), - profile, - signin, - ProfileSyncService::AUTO_START, - true); - } + static ProfileKeyedService* BuildCrosService( + content::BrowserContext* context) { + Profile* profile = static_cast<Profile*>(context); + SigninManagerBase* signin = + SigninManagerFactory::GetForProfile(profile); + signin->SetAuthenticatedUsername("test_user"); + return new TestProfileSyncService( + new ProfileSyncComponentsFactoryMock(), + profile, + signin, + ProfileSyncService::AUTO_START, + true); + } protected: virtual void CreateSyncService() OVERRIDE { @@ -213,7 +215,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartFirstTime) { EXPECT_TRUE(sync_->ShouldPushChanges()); } -ProfileKeyedService* BuildFakeTokenService(Profile* profile) { +ProfileKeyedService* BuildFakeTokenService(content::BrowserContext* profile) { return new FakeTokenService(); } diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 0070353..99608b98 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -101,8 +101,8 @@ class HistoryServiceMock : public HistoryService { virtual ~HistoryServiceMock() {} }; -ProfileKeyedService* BuildHistoryService(Profile* profile) { - return new HistoryServiceMock(profile); +ProfileKeyedService* BuildHistoryService(content::BrowserContext* profile) { + return new HistoryServiceMock(static_cast<Profile*>(profile)); } class TestTypedUrlModelAssociator : public TypedUrlModelAssociator { diff --git a/chrome/browser/sync/sync_global_error_unittest.cc b/chrome/browser/sync/sync_global_error_unittest.cc index 6abddb4..0b613cd 100644 --- a/chrome/browser/sync/sync_global_error_unittest.cc +++ b/chrome/browser/sync/sync_global_error_unittest.cc @@ -62,7 +62,7 @@ class FakeLoginUI : public LoginUIService::LoginUI { int focus_ui_call_count_; }; -ProfileKeyedService* BuildMockLoginUIService(Profile* profile) { +ProfileKeyedService* BuildMockLoginUIService(content::BrowserContext* profile) { return new FakeLoginUIService(); } diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index 71f2a3d..0ea5c31 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -228,7 +228,8 @@ TestProfileSyncService::~TestProfileSyncService() { // static ProfileKeyedService* TestProfileSyncService::BuildAutoStartAsyncInit( - Profile* profile) { + content::BrowserContext* context) { + Profile* profile = static_cast<Profile*>(context); SigninManagerBase* signin = SigninManagerFactory::GetForProfile(profile); ProfileSyncComponentsFactoryMock* factory = diff --git a/chrome/browser/sync/test_profile_sync_service.h b/chrome/browser/sync/test_profile_sync_service.h index 7951360..00459d9 100644 --- a/chrome/browser/sync/test_profile_sync_service.h +++ b/chrome/browser/sync/test_profile_sync_service.h @@ -131,7 +131,8 @@ class TestProfileSyncService : public ProfileSyncService { // We implement our own version to avoid some DCHECKs. virtual syncer::UserShare* GetUserShare() const OVERRIDE; - static ProfileKeyedService* BuildAutoStartAsyncInit(Profile* profile); + static ProfileKeyedService* BuildAutoStartAsyncInit( + content::BrowserContext* profile); ProfileSyncComponentsFactoryMock* components_factory_mock(); diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc index 5a4f5ae..2bc77a9 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.cc +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.cc @@ -45,7 +45,9 @@ SyncFileSystemServiceFactory::SyncFileSystemServiceFactory() SyncFileSystemServiceFactory::~SyncFileSystemServiceFactory() {} ProfileKeyedService* SyncFileSystemServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); + SyncFileSystemService* service = new SyncFileSystemService(profile); scoped_ptr<LocalFileSyncService> local_file_service( diff --git a/chrome/browser/sync_file_system/sync_file_system_service_factory.h b/chrome/browser/sync_file_system/sync_file_system_service_factory.h index 052b171..51e1122 100644 --- a/chrome/browser/sync_file_system/sync_file_system_service_factory.h +++ b/chrome/browser/sync_file_system/sync_file_system_service_factory.h @@ -38,7 +38,7 @@ class SyncFileSystemServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory overrides. virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; mutable scoped_ptr<RemoteFileSyncService> mock_remote_file_service_; }; diff --git a/chrome/browser/themes/theme_service_factory.cc b/chrome/browser/themes/theme_service_factory.cc index f957a3f..4e64e39 100644 --- a/chrome/browser/themes/theme_service_factory.cc +++ b/chrome/browser/themes/theme_service_factory.cc @@ -45,14 +45,14 @@ ThemeServiceFactory::ThemeServiceFactory() ThemeServiceFactory::~ThemeServiceFactory() {} ProfileKeyedService* ThemeServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { ThemeService* provider = NULL; #if defined(TOOLKIT_GTK) provider = new GtkThemeService; #else provider = new ThemeService; #endif - provider->Init(profile); + provider->Init(static_cast<Profile*>(profile)); return provider; } diff --git a/chrome/browser/themes/theme_service_factory.h b/chrome/browser/themes/theme_service_factory.h index da8271b..a35382e 100644 --- a/chrome/browser/themes/theme_service_factory.h +++ b/chrome/browser/themes/theme_service_factory.h @@ -42,7 +42,7 @@ class ThemeServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc index 6822829..bb845d8 100644 --- a/chrome/browser/themes/theme_syncable_service_unittest.cc +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc @@ -132,7 +132,7 @@ class FakeThemeService : public ThemeService { bool is_dirty_; }; -ProfileKeyedService* BuildMockThemeService(Profile* profile) { +ProfileKeyedService* BuildMockThemeService(content::BrowserContext* profile) { return new FakeThemeService; } diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.cc b/chrome/browser/thumbnails/thumbnail_service_factory.cc index 2549b7d..4de144a 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.cc +++ b/chrome/browser/thumbnails/thumbnail_service_factory.cc @@ -34,7 +34,8 @@ ThumbnailServiceFactory* ThumbnailServiceFactory::GetInstance() { } scoped_refptr<RefcountedProfileKeyedService> - ThumbnailServiceFactory::BuildServiceInstanceFor(Profile* profile) const { + ThumbnailServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* profile) const { return scoped_refptr<RefcountedProfileKeyedService>( - new ThumbnailServiceImpl(profile)); + new ThumbnailServiceImpl(static_cast<Profile*>(profile))); } diff --git a/chrome/browser/thumbnails/thumbnail_service_factory.h b/chrome/browser/thumbnails/thumbnail_service_factory.h index d7e5a44..9126a6a 100644 --- a/chrome/browser/thumbnails/thumbnail_service_factory.h +++ b/chrome/browser/thumbnails/thumbnail_service_factory.h @@ -36,7 +36,7 @@ class ThumbnailServiceFactory : public RefcountedProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(ThumbnailServiceFactory); }; diff --git a/chrome/browser/ui/ash/app_sync_ui_state_factory.cc b/chrome/browser/ui/ash/app_sync_ui_state_factory.cc index 6967df9..e284734 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state_factory.cc +++ b/chrome/browser/ui/ash/app_sync_ui_state_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/ash/app_sync_ui_state_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/ash/app_sync_ui_state.h" @@ -32,7 +33,8 @@ AppSyncUIStateFactory::~AppSyncUIStateFactory() { } ProfileKeyedService* AppSyncUIStateFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); DCHECK(AppSyncUIState::ShouldObserveAppSyncForProfile(profile)); return new AppSyncUIState(profile); } diff --git a/chrome/browser/ui/ash/app_sync_ui_state_factory.h b/chrome/browser/ui/ash/app_sync_ui_state_factory.h index 57583ce..1d6b6b1 100644 --- a/chrome/browser/ui/ash/app_sync_ui_state_factory.h +++ b/chrome/browser/ui/ash/app_sync_ui_state_factory.h @@ -28,7 +28,7 @@ class AppSyncUIStateFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory overrides: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(AppSyncUIStateFactory); }; diff --git a/chrome/browser/ui/bookmarks/bookmark_unittest.cc b/chrome/browser/ui/bookmarks/bookmark_unittest.cc index da34d00..bc285a5 100644 --- a/chrome/browser/ui/bookmarks/bookmark_unittest.cc +++ b/chrome/browser/ui/bookmarks/bookmark_unittest.cc @@ -56,8 +56,9 @@ class BookmarkInstantExtendedTest : public BrowserWithTestWindowTest { } private: - static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { - return new TemplateURLService(profile); + static ProfileKeyedService* CreateTemplateURLService( + content::BrowserContext* profile) { + return new TemplateURLService(static_cast<Profile*>(profile)); } DISALLOW_COPY_AND_ASSIGN(BookmarkInstantExtendedTest); diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.cc b/chrome/browser/ui/find_bar/find_bar_state_factory.cc index 68a6e62..b376233 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.cc +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.cc @@ -41,7 +41,7 @@ FindBarStateFactory::FindBarStateFactory() FindBarStateFactory::~FindBarStateFactory() {} ProfileKeyedService* FindBarStateFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new FindBarState; } diff --git a/chrome/browser/ui/find_bar/find_bar_state_factory.h b/chrome/browser/ui/find_bar/find_bar_state_factory.h index c3a2274..e23aaad 100644 --- a/chrome/browser/ui/find_bar/find_bar_state_factory.h +++ b/chrome/browser/ui/find_bar/find_bar_state_factory.h @@ -32,7 +32,7 @@ class FindBarStateFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(FindBarStateFactory); diff --git a/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc b/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc index 54aacab..9543489 100644 --- a/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc +++ b/chrome/browser/ui/gesture_prefs_observer_factory_aura.cc @@ -354,8 +354,8 @@ GesturePrefsObserverFactoryAura::GesturePrefsObserverFactoryAura() GesturePrefsObserverFactoryAura::~GesturePrefsObserverFactoryAura() {} ProfileKeyedService* GesturePrefsObserverFactoryAura::BuildServiceInstanceFor( - Profile* profile) const { - return new GesturePrefsObserver(profile->GetPrefs()); + content::BrowserContext* profile) const { + return new GesturePrefsObserver(static_cast<Profile*>(profile)->GetPrefs()); } void GesturePrefsObserverFactoryAura::RegisterOverscrollPrefs( diff --git a/chrome/browser/ui/gesture_prefs_observer_factory_aura.h b/chrome/browser/ui/gesture_prefs_observer_factory_aura.h index 9281149..e9d0ba6 100644 --- a/chrome/browser/ui/gesture_prefs_observer_factory_aura.h +++ b/chrome/browser/ui/gesture_prefs_observer_factory_aura.h @@ -30,7 +30,7 @@ class GesturePrefsObserverFactoryAura : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; diff --git a/chrome/browser/ui/global_error/global_error_service_factory.cc b/chrome/browser/ui/global_error/global_error_service_factory.cc index 88694a4..a6eb6e6 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.cc +++ b/chrome/browser/ui/global_error/global_error_service_factory.cc @@ -4,6 +4,7 @@ #include "chrome/browser/ui/global_error/global_error_service_factory.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/ui/global_error/global_error_service.h" @@ -27,8 +28,8 @@ GlobalErrorServiceFactory::~GlobalErrorServiceFactory() { } ProfileKeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new GlobalErrorService(profile); + content::BrowserContext* profile) const { + return new GlobalErrorService(static_cast<Profile*>(profile)); } bool GlobalErrorServiceFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/ui/global_error/global_error_service_factory.h b/chrome/browser/ui/global_error/global_error_service_factory.h index 85f7a3d..e8d6122 100644 --- a/chrome/browser/ui/global_error/global_error_service_factory.h +++ b/chrome/browser/ui/global_error/global_error_service_factory.h @@ -29,7 +29,7 @@ class GlobalErrorServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(GlobalErrorServiceFactory); diff --git a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc index 9cd6449..f5a5273 100644 --- a/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc +++ b/chrome/browser/ui/sync/one_click_signin_helper_unittest.cc @@ -155,8 +155,8 @@ class OneClickTestProfileSyncService : public TestProfileSyncService { // Helper routine to be used in conjunction with // ProfileKeyedServiceFactory::SetTestingFactory(). - static ProfileKeyedService* Build(Profile* profile) { - return new OneClickTestProfileSyncService(profile); + static ProfileKeyedService* Build(content::BrowserContext* profile) { + return new OneClickTestProfileSyncService(static_cast<Profile*>(profile)); } // Need to control this for certain tests. @@ -188,8 +188,9 @@ class OneClickTestProfileSyncService : public TestProfileSyncService { bool first_setup_in_progress_; }; -static ProfileKeyedService* BuildSigninManagerMock(Profile* profile) { - return new SigninManagerMock(profile); +static ProfileKeyedService* BuildSigninManagerMock( + content::BrowserContext* profile) { + return new SigninManagerMock(static_cast<Profile*>(profile)); } } // namespace diff --git a/chrome/browser/ui/tabs/pinned_tab_service_factory.cc b/chrome/browser/ui/tabs/pinned_tab_service_factory.cc index 40a7eeb..1d86612 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_factory.cc +++ b/chrome/browser/ui/tabs/pinned_tab_service_factory.cc @@ -28,8 +28,8 @@ PinnedTabServiceFactory::~PinnedTabServiceFactory() { } ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new PinnedTabService(profile); + content::BrowserContext* profile) const { + return new PinnedTabService(static_cast<Profile*>(profile)); } bool PinnedTabServiceFactory::ServiceIsCreatedWithProfile() const { diff --git a/chrome/browser/ui/tabs/pinned_tab_service_factory.h b/chrome/browser/ui/tabs/pinned_tab_service_factory.h index 4f9d672..9137bf2 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_factory.h +++ b/chrome/browser/ui/tabs/pinned_tab_service_factory.h @@ -30,7 +30,7 @@ class PinnedTabServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsCreatedWithProfile() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; }; diff --git a/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc b/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc index d6f760e..9397526 100644 --- a/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc +++ b/chrome/browser/ui/tabs/pinned_tab_service_unittest.cc @@ -18,8 +18,8 @@ namespace { -ProfileKeyedService* BuildPinnedTabService(Profile* profile) { - return new PinnedTabService(profile); +ProfileKeyedService* BuildPinnedTabService(content::BrowserContext* profile) { + return new PinnedTabService(static_cast<Profile*>(profile)); } PinnedTabService* BuildForProfile(Profile* profile) { diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc index a76fe84..40d3272 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_unittest.cc @@ -50,8 +50,9 @@ class BookmarkBarViewInstantExtendedTest : public BrowserWithTestWindowTest { } private: - static ProfileKeyedService* CreateTemplateURLService(Profile* profile) { - return new TemplateURLService(profile); + static ProfileKeyedService* CreateTemplateURLService( + content::BrowserContext* profile) { + return new TemplateURLService(static_cast<Profile*>(profile)); } DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewInstantExtendedTest); diff --git a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc index d2590a6..1097342 100644 --- a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc +++ b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.cc @@ -31,8 +31,8 @@ AppResourceCacheFactory::AppResourceCacheFactory() AppResourceCacheFactory::~AppResourceCacheFactory() {} ProfileKeyedService* AppResourceCacheFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new NTPResourceCache(profile); + content::BrowserContext* profile) const { + return new NTPResourceCache(static_cast<Profile*>(profile)); } bool AppResourceCacheFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h index f5ecf76..14b95f6 100644 --- a/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h +++ b/chrome/browser/ui/webui/ntp/app_resource_cache_factory.h @@ -27,7 +27,7 @@ class AppResourceCacheFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; }; diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc index f203884..8bd2bab 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.cc @@ -31,8 +31,8 @@ NTPResourceCacheFactory::NTPResourceCacheFactory() NTPResourceCacheFactory::~NTPResourceCacheFactory() {} ProfileKeyedService* NTPResourceCacheFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new NTPResourceCache(profile); + content::BrowserContext* profile) const { + return new NTPResourceCache(static_cast<Profile*>(profile)); } bool NTPResourceCacheFactory::ServiceRedirectedInIncognito() const { diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h index 93fce1a..dfd834b 100644 --- a/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h +++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache_factory.h @@ -27,7 +27,7 @@ class NTPResourceCacheFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; }; diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.cc b/chrome/browser/ui/webui/signin/login_ui_service_factory.cc index 3da029f..9ae2d26 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.cc +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.cc @@ -29,6 +29,6 @@ LoginUIServiceFactory* LoginUIServiceFactory::GetInstance() { } ProfileKeyedService* LoginUIServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { - return new LoginUIService(profile); + content::BrowserContext* profile) const { + return new LoginUIService(static_cast<Profile*>(profile)); } diff --git a/chrome/browser/ui/webui/signin/login_ui_service_factory.h b/chrome/browser/ui/webui/signin/login_ui_service_factory.h index 93dee68..d5ebb33 100644 --- a/chrome/browser/ui/webui/signin/login_ui_service_factory.h +++ b/chrome/browser/ui/webui/signin/login_ui_service_factory.h @@ -32,7 +32,7 @@ class LoginUIServiceFactory : public ProfileKeyedServiceFactory { // ProfileKeyedServiceFactory: virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(LoginUIServiceFactory); }; diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc index 345baa2..ded7816 100644 --- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc +++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc @@ -327,8 +327,9 @@ class SigninManagerBaseMock : public FakeSigninManagerBase { MOCK_CONST_METHOD1(IsAllowedUsername, bool(const std::string& username)); }; -static ProfileKeyedService* BuildSigninManagerBaseMock(Profile* profile) { - return new SigninManagerBaseMock(profile); +static ProfileKeyedService* BuildSigninManagerBaseMock( + content::BrowserContext* profile) { + return new SigninManagerBaseMock(static_cast<Profile*>(profile)); } // The boolean parameter indicates whether the test is run with ClientOAuth @@ -668,8 +669,9 @@ class SigninManagerMock : public FakeSigninManager { }; } -static ProfileKeyedService* BuildSigninManagerMock(Profile* profile) { - return new SigninManagerMock(profile); +static ProfileKeyedService* BuildSigninManagerMock( + content::BrowserContext* profile) { + return new SigninManagerMock(static_cast<Profile*>(profile)); } class SyncSetupHandlerNonCrosTest : public SyncSetupHandlerTest { diff --git a/chrome/browser/usb/usb_service_factory.cc b/chrome/browser/usb/usb_service_factory.cc index 823d582..6b91c19 100644 --- a/chrome/browser/usb/usb_service_factory.cc +++ b/chrome/browser/usb/usb_service_factory.cc @@ -5,6 +5,7 @@ #include "chrome/browser/usb/usb_service_factory.h" #include "base/memory/singleton.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_dependency_manager.h" #include "chrome/browser/usb/usb_service.h" @@ -23,6 +24,6 @@ UsbServiceFactory::UsbServiceFactory() : ProfileKeyedServiceFactory( UsbServiceFactory::~UsbServiceFactory() {} ProfileKeyedService* UsbServiceFactory::BuildServiceInstanceFor( - Profile* profile) const { + content::BrowserContext* profile) const { return new UsbService(); } diff --git a/chrome/browser/usb/usb_service_factory.h b/chrome/browser/usb/usb_service_factory.h index 5a19fb0..662b46a 100644 --- a/chrome/browser/usb/usb_service_factory.h +++ b/chrome/browser/usb/usb_service_factory.h @@ -25,7 +25,7 @@ class UsbServiceFactory : public ProfileKeyedServiceFactory { virtual ~UsbServiceFactory(); virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; }; #endif // CHROME_BROWSER_USB_USB_SERVICE_FACTORY_H_ diff --git a/chrome/browser/user_style_sheet_watcher_factory.cc b/chrome/browser/user_style_sheet_watcher_factory.cc index f0f6b92..64367fc 100644 --- a/chrome/browser/user_style_sheet_watcher_factory.cc +++ b/chrome/browser/user_style_sheet_watcher_factory.cc @@ -30,7 +30,9 @@ UserStyleSheetWatcherFactory::~UserStyleSheetWatcherFactory() { } scoped_refptr<RefcountedProfileKeyedService> -UserStyleSheetWatcherFactory::BuildServiceInstanceFor(Profile* profile) const { +UserStyleSheetWatcherFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { + Profile* profile = static_cast<Profile*>(context); scoped_refptr<UserStyleSheetWatcher> user_style_sheet_watcher( new UserStyleSheetWatcher(profile, profile->GetPath())); user_style_sheet_watcher->Init(); diff --git a/chrome/browser/user_style_sheet_watcher_factory.h b/chrome/browser/user_style_sheet_watcher_factory.h index 51484f7..4cc730b 100644 --- a/chrome/browser/user_style_sheet_watcher_factory.h +++ b/chrome/browser/user_style_sheet_watcher_factory.h @@ -28,7 +28,7 @@ class UserStyleSheetWatcherFactory // ProfileKeyedServiceFactory: virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* context) const OVERRIDE; virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; diff --git a/chrome/browser/webdata/web_data_service_factory.cc b/chrome/browser/webdata/web_data_service_factory.cc index c07d5fb..3ac4432 100644 --- a/chrome/browser/webdata/web_data_service_factory.cc +++ b/chrome/browser/webdata/web_data_service_factory.cc @@ -186,9 +186,9 @@ bool WebDataServiceFactory::ServiceRedirectedInIncognito() const { return true; } -ProfileKeyedService* -WebDataServiceFactory::BuildServiceInstanceFor(Profile* profile) const { - return new WebDataServiceWrapper(profile); +ProfileKeyedService* WebDataServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* profile) const { + return new WebDataServiceWrapper(static_cast<Profile*>(profile)); } bool WebDataServiceFactory::ServiceIsNULLWhileTesting() const { diff --git a/chrome/browser/webdata/web_data_service_factory.h b/chrome/browser/webdata/web_data_service_factory.h index 28772f7..68c6c57 100644 --- a/chrome/browser/webdata/web_data_service_factory.h +++ b/chrome/browser/webdata/web_data_service_factory.h @@ -69,7 +69,7 @@ class WebDataServiceFactory : public ProfileKeyedServiceFactory { // |ProfileKeyedBaseFactory| methods: virtual bool ServiceRedirectedInIncognito() const OVERRIDE; virtual ProfileKeyedService* BuildServiceInstanceFor( - Profile* profile) const OVERRIDE; + content::BrowserContext* profile) const OVERRIDE; virtual bool ServiceIsNULLWhileTesting() const OVERRIDE; DISALLOW_COPY_AND_ASSIGN(WebDataServiceFactory); diff --git a/chrome/test/base/chrome_render_view_host_test_harness.cc b/chrome/test/base/chrome_render_view_host_test_harness.cc index d4fc77e..c3334b7 100644 --- a/chrome/test/base/chrome_render_view_host_test_harness.cc +++ b/chrome/test/base/chrome_render_view_host_test_harness.cc @@ -35,7 +35,9 @@ RenderViewHostTester* ChromeRenderViewHostTestHarness::rvh_tester() { return RenderViewHostTester::For(rvh()); } -static ProfileKeyedService* BuildSigninManagerFake(Profile* profile) { +static ProfileKeyedService* BuildSigninManagerFake( + content::BrowserContext* context) { + Profile* profile = static_cast<Profile*>(context); #if defined (OS_CHROMEOS) return new FakeSigninManagerBase(profile); #else diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 54c3276..a198ded 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -142,9 +142,10 @@ class TestExtensionURLRequestContextGetter scoped_ptr<net::URLRequestContext> context_; }; -ProfileKeyedService* CreateTestDesktopNotificationService(Profile* profile) { +ProfileKeyedService* CreateTestDesktopNotificationService( + content::BrowserContext* profile) { #if defined(ENABLE_NOTIFICATIONS) - return new DesktopNotificationService(profile, NULL); + return new DesktopNotificationService(static_cast<Profile*>(profile), NULL); #else return NULL; #endif @@ -275,6 +276,8 @@ void TestingProfile::CreateTempProfileDir() { void TestingProfile::Init() { if (prefs_.get()) components::UserPrefs::Set(this, prefs_.get()); + else + CreateTestingPrefService(); if (!file_util::PathExists(profile_path_)) file_util::CreateDirectory(profile_path_); @@ -316,9 +319,11 @@ TestingProfile::~TestingProfile() { pref_proxy_config_tracker_->DetachFromPrefService(); } -static ProfileKeyedService* BuildFaviconService(Profile* profile) { +static ProfileKeyedService* BuildFaviconService( + content::BrowserContext* profile) { return new FaviconService( - HistoryServiceFactory::GetForProfileWithoutCreating(profile)); + HistoryServiceFactory::GetForProfileWithoutCreating( + static_cast<Profile*>(profile))); } void TestingProfile::CreateFaviconService() { @@ -327,8 +332,9 @@ void TestingProfile::CreateFaviconService() { this, BuildFaviconService); } -static ProfileKeyedService* BuildHistoryService(Profile* profile) { - return new HistoryService(profile); +static ProfileKeyedService* BuildHistoryService( + content::BrowserContext* profile) { + return new HistoryService(static_cast<Profile*>(profile)); } void TestingProfile::CreateHistoryService(bool delete_file, bool no_db) { @@ -393,7 +399,9 @@ void TestingProfile::DestroyTopSites() { } } -static ProfileKeyedService* BuildBookmarkModel(Profile* profile) { +static ProfileKeyedService* BuildBookmarkModel( + content::BrowserContext* context) { + Profile* profile = static_cast<Profile*>(context); BookmarkModel* bookmark_model = new BookmarkModel(profile); bookmark_model->Load(profile->GetIOTaskRunner()); return bookmark_model; @@ -420,8 +428,8 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) { } static ProfileKeyedService* BuildWebDataService( - Profile* profile) { - return new WebDataServiceWrapper(profile); + content::BrowserContext* profile) { + return new WebDataServiceWrapper(static_cast<Profile*>(profile)); } void TestingProfile::CreateWebDataService() { diff --git a/components/autofill/browser/autocomplete_history_manager_unittest.cc b/components/autofill/browser/autocomplete_history_manager_unittest.cc index 8567221..7b308dc 100644 --- a/components/autofill/browser/autocomplete_history_manager_unittest.cc +++ b/components/autofill/browser/autocomplete_history_manager_unittest.cc @@ -62,7 +62,7 @@ MockWebDataService* MockWebDataService::current_mock_web_data_service_ = NULL; class MockWebDataServiceWrapperCurrent : public MockWebDataServiceWrapperBase { public: - static ProfileKeyedService* Build(Profile* profile) { + static ProfileKeyedService* Build(content::BrowserContext* profile) { return new MockWebDataServiceWrapperCurrent(); } diff --git a/components/autofill/browser/autofill_manager_unittest.cc b/components/autofill/browser/autofill_manager_unittest.cc index 9f53518..0c9b9ce0 100644 --- a/components/autofill/browser/autofill_manager_unittest.cc +++ b/components/autofill/browser/autofill_manager_unittest.cc @@ -86,7 +86,7 @@ class TestPersonalDataManager : public PersonalDataManager { } // Factory method for keyed service. PersonalDataManager is NULL for testing. - static ProfileKeyedService* Build(Profile* profile) { + static ProfileKeyedService* Build(content::BrowserContext* profile) { return NULL; } diff --git a/components/user_prefs/user_prefs.cc b/components/user_prefs/user_prefs.cc index 96866d1..73b8ece 100644 --- a/components/user_prefs/user_prefs.cc +++ b/components/user_prefs/user_prefs.cc @@ -25,6 +25,7 @@ void* UserDataKey() { // static PrefService* UserPrefs::Get(content::BrowserContext* context) { DCHECK(context); + DCHECK(context->GetUserData(UserDataKey())); return static_cast<UserPrefs*>( context->GetUserData(UserDataKey()))->prefs_; } |