OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 64 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
65 #include "chrome/browser/prerender/prerender_manager_factory.h" | 65 #include "chrome/browser/prerender/prerender_manager_factory.h" |
66 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 66 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
67 #include "chrome/browser/profiles/chrome_version_service.h" | 67 #include "chrome/browser/profiles/chrome_version_service.h" |
68 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | 68 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
69 #include "chrome/browser/profiles/profile_destroyer.h" | 69 #include "chrome/browser/profiles/profile_destroyer.h" |
70 #include "chrome/browser/profiles/profile_info_cache.h" | 70 #include "chrome/browser/profiles/profile_info_cache.h" |
71 #include "chrome/browser/profiles/profile_manager.h" | 71 #include "chrome/browser/profiles/profile_manager.h" |
72 #include "chrome/browser/profiles/profile_metrics.h" | 72 #include "chrome/browser/profiles/profile_metrics.h" |
73 #include "chrome/browser/search_engines/template_url_fetcher.h" | 73 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 74 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 75 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
74 #include "chrome/browser/sessions/session_service_factory.h" | 76 #include "chrome/browser/sessions/session_service_factory.h" |
75 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 77 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
76 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 78 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
77 #include "chrome/browser/webdata/web_data_service.h" | 79 #include "chrome/browser/webdata/web_data_service.h" |
78 #include "chrome/common/chrome_constants.h" | 80 #include "chrome/common/chrome_constants.h" |
79 #include "chrome/common/chrome_paths_internal.h" | 81 #include "chrome/common/chrome_paths_internal.h" |
80 #include "chrome/common/chrome_switches.h" | 82 #include "chrome/common/chrome_switches.h" |
81 #include "chrome/common/chrome_version_info.h" | 83 #include "chrome/common/chrome_version_info.h" |
82 #include "chrome/common/net/url_fixer_upper.h" | 84 #include "chrome/common/net/url_fixer_upper.h" |
83 #include "chrome/common/pref_names.h" | 85 #include "chrome/common/pref_names.h" |
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 | 1077 |
1076 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { | 1078 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { |
1077 return DownloadServiceFactory::GetForBrowserContext(this)-> | 1079 return DownloadServiceFactory::GetForBrowserContext(this)-> |
1078 GetDownloadManagerDelegate(); | 1080 GetDownloadManagerDelegate(); |
1079 } | 1081 } |
1080 | 1082 |
1081 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { | 1083 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { |
1082 return GetExtensionSpecialStoragePolicy(); | 1084 return GetExtensionSpecialStoragePolicy(); |
1083 } | 1085 } |
1084 | 1086 |
| 1087 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { |
| 1088 return gcm::GCMProfileServiceFactory::GetForProfile( |
| 1089 this)->push_messaging_service(); |
| 1090 } |
| 1091 |
1085 bool ProfileImpl::IsSameProfile(Profile* profile) { | 1092 bool ProfileImpl::IsSameProfile(Profile* profile) { |
1086 if (profile == static_cast<Profile*>(this)) | 1093 if (profile == static_cast<Profile*>(this)) |
1087 return true; | 1094 return true; |
1088 Profile* otr_profile = off_the_record_profile_.get(); | 1095 Profile* otr_profile = off_the_record_profile_.get(); |
1089 return otr_profile && profile == otr_profile; | 1096 return otr_profile && profile == otr_profile; |
1090 } | 1097 } |
1091 | 1098 |
1092 Time ProfileImpl::GetStartTime() const { | 1099 Time ProfileImpl::GetStartTime() const { |
1093 return start_time_; | 1100 return start_time_; |
1094 } | 1101 } |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1359 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1366 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
1360 #if defined(OS_CHROMEOS) | 1367 #if defined(OS_CHROMEOS) |
1361 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1368 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
1362 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1369 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
1363 g_browser_process->local_state()); | 1370 g_browser_process->local_state()); |
1364 } | 1371 } |
1365 #endif // defined(OS_CHROMEOS) | 1372 #endif // defined(OS_CHROMEOS) |
1366 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1373 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
1367 GetPrefs(), g_browser_process->local_state()); | 1374 GetPrefs(), g_browser_process->local_state()); |
1368 } | 1375 } |
OLD | NEW |