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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" | 62 #include "chrome/browser/prefs/tracked/tracked_preference_validation_delegate.h" |
63 #include "chrome/browser/prerender/prerender_manager_factory.h" | 63 #include "chrome/browser/prerender/prerender_manager_factory.h" |
64 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" | 64 #include "chrome/browser/profiles/bookmark_model_loaded_observer.h" |
65 #include "chrome/browser/profiles/chrome_version_service.h" | 65 #include "chrome/browser/profiles/chrome_version_service.h" |
66 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | 66 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
67 #include "chrome/browser/profiles/profile_destroyer.h" | 67 #include "chrome/browser/profiles/profile_destroyer.h" |
68 #include "chrome/browser/profiles/profile_info_cache.h" | 68 #include "chrome/browser/profiles/profile_info_cache.h" |
69 #include "chrome/browser/profiles/profile_manager.h" | 69 #include "chrome/browser/profiles/profile_manager.h" |
70 #include "chrome/browser/profiles/profile_metrics.h" | 70 #include "chrome/browser/profiles/profile_metrics.h" |
71 #include "chrome/browser/search_engines/template_url_fetcher.h" | 71 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 72 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
| 73 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
72 #include "chrome/browser/sessions/session_service_factory.h" | 74 #include "chrome/browser/sessions/session_service_factory.h" |
73 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 75 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
74 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 76 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
75 #include "chrome/browser/webdata/web_data_service.h" | 77 #include "chrome/browser/webdata/web_data_service.h" |
76 #include "chrome/common/chrome_constants.h" | 78 #include "chrome/common/chrome_constants.h" |
77 #include "chrome/common/chrome_paths_internal.h" | 79 #include "chrome/common/chrome_paths_internal.h" |
78 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
79 #include "chrome/common/chrome_version_info.h" | 81 #include "chrome/common/chrome_version_info.h" |
80 #include "chrome/common/pref_names.h" | 82 #include "chrome/common/pref_names.h" |
81 #include "chrome/common/url_constants.h" | 83 #include "chrome/common/url_constants.h" |
(...skipping 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 | 1084 |
1083 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { | 1085 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { |
1084 return DownloadServiceFactory::GetForBrowserContext(this)-> | 1086 return DownloadServiceFactory::GetForBrowserContext(this)-> |
1085 GetDownloadManagerDelegate(); | 1087 GetDownloadManagerDelegate(); |
1086 } | 1088 } |
1087 | 1089 |
1088 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { | 1090 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { |
1089 return GetExtensionSpecialStoragePolicy(); | 1091 return GetExtensionSpecialStoragePolicy(); |
1090 } | 1092 } |
1091 | 1093 |
| 1094 content::PushMessagingService* ProfileImpl::GetPushMessagingService() { |
| 1095 return gcm::GCMProfileServiceFactory::GetForProfile( |
| 1096 this)->push_messaging_service(); |
| 1097 } |
| 1098 |
1092 bool ProfileImpl::IsSameProfile(Profile* profile) { | 1099 bool ProfileImpl::IsSameProfile(Profile* profile) { |
1093 if (profile == static_cast<Profile*>(this)) | 1100 if (profile == static_cast<Profile*>(this)) |
1094 return true; | 1101 return true; |
1095 Profile* otr_profile = off_the_record_profile_.get(); | 1102 Profile* otr_profile = off_the_record_profile_.get(); |
1096 return otr_profile && profile == otr_profile; | 1103 return otr_profile && profile == otr_profile; |
1097 } | 1104 } |
1098 | 1105 |
1099 Time ProfileImpl::GetStartTime() const { | 1106 Time ProfileImpl::GetStartTime() const { |
1100 return start_time_; | 1107 return start_time_; |
1101 } | 1108 } |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1367 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1374 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
1368 #if defined(OS_CHROMEOS) | 1375 #if defined(OS_CHROMEOS) |
1369 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1376 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
1370 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1377 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
1371 g_browser_process->local_state()); | 1378 g_browser_process->local_state()); |
1372 } | 1379 } |
1373 #endif // defined(OS_CHROMEOS) | 1380 #endif // defined(OS_CHROMEOS) |
1374 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1381 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
1375 GetPrefs(), g_browser_process->local_state()); | 1382 GetPrefs(), g_browser_process->local_state()); |
1376 } | 1383 } |
OLD | NEW |