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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #include "chrome/browser/profiles/chrome_version_service.h" | 61 #include "chrome/browser/profiles/chrome_version_service.h" |
62 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" | 62 #include "chrome/browser/profiles/gaia_info_update_service_factory.h" |
63 #include "chrome/browser/profiles/profile_destroyer.h" | 63 #include "chrome/browser/profiles/profile_destroyer.h" |
64 #include "chrome/browser/profiles/profile_info_cache.h" | 64 #include "chrome/browser/profiles/profile_info_cache.h" |
65 #include "chrome/browser/profiles/profile_manager.h" | 65 #include "chrome/browser/profiles/profile_manager.h" |
66 #include "chrome/browser/profiles/profile_metrics.h" | 66 #include "chrome/browser/profiles/profile_metrics.h" |
67 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 67 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
68 #include "chrome/browser/search_engines/template_url_fetcher.h" | 68 #include "chrome/browser/search_engines/template_url_fetcher.h" |
69 #include "chrome/browser/services/gcm/gcm_profile_service.h" | 69 #include "chrome/browser/services/gcm/gcm_profile_service.h" |
70 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" | 70 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 71 #include "chrome/browser/services/gcm/push_messaging_service_impl.h" |
71 #include "chrome/browser/sessions/session_service_factory.h" | 72 #include "chrome/browser/sessions/session_service_factory.h" |
72 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 73 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
73 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 74 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
74 #include "chrome/browser/webdata/web_data_service.h" | 75 #include "chrome/browser/webdata/web_data_service.h" |
75 #include "chrome/common/chrome_constants.h" | 76 #include "chrome/common/chrome_constants.h" |
76 #include "chrome/common/chrome_paths_internal.h" | 77 #include "chrome/common/chrome_paths_internal.h" |
77 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
78 #include "chrome/common/chrome_version_info.h" | 79 #include "chrome/common/chrome_version_info.h" |
79 #include "chrome/common/pref_names.h" | 80 #include "chrome/common/pref_names.h" |
80 #include "chrome/common/url_constants.h" | 81 #include "chrome/common/url_constants.h" |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 chrome::NOTIFICATION_PROFILE_CREATED, | 654 chrome::NOTIFICATION_PROFILE_CREATED, |
654 content::Source<Profile>(this), | 655 content::Source<Profile>(this), |
655 content::NotificationService::NoDetails()); | 656 content::NotificationService::NoDetails()); |
656 | 657 |
657 #if !defined(OS_CHROMEOS) | 658 #if !defined(OS_CHROMEOS) |
658 // Listen for bookmark model load, to bootstrap the sync service. | 659 // Listen for bookmark model load, to bootstrap the sync service. |
659 // On CrOS sync service will be initialized after sign in. | 660 // On CrOS sync service will be initialized after sign in. |
660 BookmarkModel* model = BookmarkModelFactory::GetForProfile(this); | 661 BookmarkModel* model = BookmarkModelFactory::GetForProfile(this); |
661 model->AddObserver(new BookmarkModelLoadedObserver(this)); | 662 model->AddObserver(new BookmarkModelLoadedObserver(this)); |
662 #endif | 663 #endif |
| 664 |
| 665 gcm::PushMessagingServiceImpl::InitializeForProfile(this); |
663 } | 666 } |
664 | 667 |
665 void ProfileImpl::InitHostZoomMap() { | 668 void ProfileImpl::InitHostZoomMap() { |
666 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 669 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
667 host_zoom_map->SetDefaultZoomLevel( | 670 host_zoom_map->SetDefaultZoomLevel( |
668 prefs_->GetDouble(prefs::kDefaultZoomLevel)); | 671 prefs_->GetDouble(prefs::kDefaultZoomLevel)); |
669 | 672 |
670 const base::DictionaryValue* host_zoom_dictionary = | 673 const base::DictionaryValue* host_zoom_dictionary = |
671 prefs_->GetDictionary(prefs::kPerHostZoomLevels); | 674 prefs_->GetDictionary(prefs::kPerHostZoomLevels); |
672 // Careful: The returned value could be NULL if the pref has never been set. | 675 // Careful: The returned value could be NULL if the pref has never been set. |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1322 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { | 1325 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { |
1323 #if defined(OS_CHROMEOS) | 1326 #if defined(OS_CHROMEOS) |
1324 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 1327 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
1325 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 1328 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
1326 g_browser_process->local_state()); | 1329 g_browser_process->local_state()); |
1327 } | 1330 } |
1328 #endif // defined(OS_CHROMEOS) | 1331 #endif // defined(OS_CHROMEOS) |
1329 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 1332 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
1330 GetPrefs(), g_browser_process->local_state()); | 1333 GetPrefs(), g_browser_process->local_state()); |
1331 } | 1334 } |
OLD | NEW |