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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "chrome/browser/profiles/profile_manager.h" | 65 #include "chrome/browser/profiles/profile_manager.h" |
66 #include "chrome/browser/search_engines/template_url_fetcher.h" | 66 #include "chrome/browser/search_engines/template_url_fetcher.h" |
67 #include "chrome/browser/sessions/session_service_factory.h" | 67 #include "chrome/browser/sessions/session_service_factory.h" |
68 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" | 68 #include "chrome/browser/speech/chrome_speech_recognition_preferences.h" |
69 #include "chrome/browser/sync/profile_sync_service_factory.h" | 69 #include "chrome/browser/sync/profile_sync_service_factory.h" |
70 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 70 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
71 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 71 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
72 #include "chrome/browser/user_style_sheet_watcher.h" | 72 #include "chrome/browser/user_style_sheet_watcher.h" |
73 #include "chrome/browser/visitedlink/visitedlink_event_listener.h" | 73 #include "chrome/browser/visitedlink/visitedlink_event_listener.h" |
74 #include "chrome/browser/visitedlink/visitedlink_master.h" | 74 #include "chrome/browser/visitedlink/visitedlink_master.h" |
| 75 #include "chrome/browser/web_resource/promo_resource_service.h" |
75 #include "chrome/browser/webdata/web_data_service.h" | 76 #include "chrome/browser/webdata/web_data_service.h" |
76 #include "chrome/common/chrome_constants.h" | 77 #include "chrome/common/chrome_constants.h" |
77 #include "chrome/common/chrome_notification_types.h" | 78 #include "chrome/common/chrome_notification_types.h" |
78 #include "chrome/common/chrome_paths_internal.h" | 79 #include "chrome/common/chrome_paths_internal.h" |
79 #include "chrome/common/chrome_switches.h" | 80 #include "chrome/common/chrome_switches.h" |
80 #include "chrome/common/chrome_version_info.h" | 81 #include "chrome/common/chrome_version_info.h" |
81 #include "chrome/common/pref_names.h" | 82 #include "chrome/common/pref_names.h" |
82 #include "chrome/common/url_constants.h" | 83 #include "chrome/common/url_constants.h" |
83 #include "content/public/browser/browser_thread.h" | 84 #include "content/public/browser/browser_thread.h" |
84 #include "content/public/browser/host_zoom_map.h" | 85 #include "content/public/browser/host_zoom_map.h" |
85 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
86 #include "content/public/browser/render_process_host.h" | 87 #include "content/public/browser/render_process_host.h" |
87 #include "content/public/browser/user_metrics.h" | 88 #include "content/public/browser/user_metrics.h" |
88 #include "grit/chromium_strings.h" | 89 #include "grit/chromium_strings.h" |
89 #include "grit/generated_resources.h" | 90 #include "grit/generated_resources.h" |
90 #include "ui/base/l10n/l10n_util.h" | 91 #include "ui/base/l10n/l10n_util.h" |
91 | 92 |
92 #if defined(ENABLE_CONFIGURATION_POLICY) | 93 #if defined(ENABLE_CONFIGURATION_POLICY) |
93 #include "chrome/browser/policy/browser_policy_connector.h" | 94 #include "chrome/browser/policy/browser_policy_connector.h" |
94 #else | 95 #else |
95 #include "chrome/browser/policy/policy_service_stub.h" | 96 #include "chrome/browser/policy/policy_service_stub.h" |
96 #endif // defined(ENABLE_CONFIGURATION_POLICY) | 97 #endif // defined(ENABLE_CONFIGURATION_POLICY) |
97 | 98 |
98 #if defined(ENABLE_PROMO_RESOURCE_SERVICE) | |
99 #include "chrome/browser/web_resource/promo_resource_service.h" | |
100 #endif // defined(ENABLE_PROMO_RESOURCE_SERVICE) | |
101 | |
102 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
103 #include "chrome/installer/util/install_util.h" | 100 #include "chrome/installer/util/install_util.h" |
104 #endif | 101 #endif |
105 | 102 |
106 #if defined(OS_CHROMEOS) | 103 #if defined(OS_CHROMEOS) |
107 #include "chrome/browser/chromeos/enterprise_extension_observer.h" | 104 #include "chrome/browser/chromeos/enterprise_extension_observer.h" |
108 #include "chrome/browser/chromeos/locale_change_guard.h" | 105 #include "chrome/browser/chromeos/locale_change_guard.h" |
109 #include "chrome/browser/chromeos/login/user_manager.h" | 106 #include "chrome/browser/chromeos/login/user_manager.h" |
110 #include "chrome/browser/chromeos/preferences.h" | 107 #include "chrome/browser/chromeos/preferences.h" |
111 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 108 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 DCHECK(success); | 440 DCHECK(success); |
444 host_zoom_map->SetZoomLevel(host, zoom_level); | 441 host_zoom_map->SetZoomLevel(host, zoom_level); |
445 } | 442 } |
446 } | 443 } |
447 | 444 |
448 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 445 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
449 content::Source<HostZoomMap>(host_zoom_map)); | 446 content::Source<HostZoomMap>(host_zoom_map)); |
450 } | 447 } |
451 | 448 |
452 void ProfileImpl::InitPromoResources() { | 449 void ProfileImpl::InitPromoResources() { |
453 #if defined(ENABLE_PROMO_RESOURCE_SERVICE) | |
454 if (promo_resource_service_) | 450 if (promo_resource_service_) |
455 return; | 451 return; |
456 | |
457 promo_resource_service_ = new PromoResourceService(this); | 452 promo_resource_service_ = new PromoResourceService(this); |
458 promo_resource_service_->StartAfterDelay(); | 453 promo_resource_service_->StartAfterDelay(); |
459 #endif | |
460 } | 454 } |
461 | 455 |
462 void ProfileImpl::InitRegisteredProtocolHandlers() { | 456 void ProfileImpl::InitRegisteredProtocolHandlers() { |
463 if (protocol_handler_registry_) | 457 if (protocol_handler_registry_) |
464 return; | 458 return; |
465 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, | 459 protocol_handler_registry_ = new ProtocolHandlerRegistry(this, |
466 new ProtocolHandlerRegistry::Delegate()); | 460 new ProtocolHandlerRegistry::Delegate()); |
467 | 461 |
468 // Install predefined protocol handlers. | 462 // Install predefined protocol handlers. |
469 InstallDefaultProtocolHandlers(); | 463 InstallDefaultProtocolHandlers(); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 if (!path.empty()) | 1101 if (!path.empty()) |
1108 *cache_path = path; | 1102 *cache_path = path; |
1109 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1103 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1110 prefs_->GetInteger(prefs::kDiskCacheSize); | 1104 prefs_->GetInteger(prefs::kDiskCacheSize); |
1111 } | 1105 } |
1112 | 1106 |
1113 base::Callback<ChromeURLDataManagerBackend*(void)> | 1107 base::Callback<ChromeURLDataManagerBackend*(void)> |
1114 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1108 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1115 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1109 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1116 } | 1110 } |
OLD | NEW |