OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/profile.h" | 5 #include "chrome/browser/profile.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "app/theme_provider.h" | 8 #include "app/theme_provider.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/browser_theme_provider.h" | 21 #include "chrome/browser/browser_theme_provider.h" |
22 #include "chrome/browser/chrome_thread.h" | 22 #include "chrome/browser/chrome_thread.h" |
23 #include "chrome/browser/dom_ui/ntp_resource_cache.h" | 23 #include "chrome/browser/dom_ui/ntp_resource_cache.h" |
24 #include "chrome/browser/download/download_manager.h" | 24 #include "chrome/browser/download/download_manager.h" |
25 #include "chrome/browser/extensions/extension_devtools_manager.h" | 25 #include "chrome/browser/extensions/extension_devtools_manager.h" |
26 #include "chrome/browser/extensions/extension_message_service.h" | 26 #include "chrome/browser/extensions/extension_message_service.h" |
27 #include "chrome/browser/extensions/extension_process_manager.h" | 27 #include "chrome/browser/extensions/extension_process_manager.h" |
28 #include "chrome/browser/extensions/extensions_service.h" | 28 #include "chrome/browser/extensions/extensions_service.h" |
29 #include "chrome/browser/extensions/user_script_master.h" | 29 #include "chrome/browser/extensions/user_script_master.h" |
30 #include "chrome/browser/favicon_service.h" | 30 #include "chrome/browser/favicon_service.h" |
| 31 #include "chrome/browser/geolocation/geolocation_permission_context.h" |
31 #include "chrome/browser/spellcheck_host.h" | 32 #include "chrome/browser/spellcheck_host.h" |
32 #include "chrome/browser/transport_security_persister.h" | 33 #include "chrome/browser/transport_security_persister.h" |
33 #include "chrome/browser/history/history.h" | 34 #include "chrome/browser/history/history.h" |
34 #include "chrome/browser/host_content_settings_map.h" | 35 #include "chrome/browser/host_content_settings_map.h" |
35 #include "chrome/browser/host_zoom_map.h" | 36 #include "chrome/browser/host_zoom_map.h" |
36 #include "chrome/browser/in_process_webkit/webkit_context.h" | 37 #include "chrome/browser/in_process_webkit/webkit_context.h" |
37 #include "chrome/browser/net/chrome_url_request_context.h" | 38 #include "chrome/browser/net/chrome_url_request_context.h" |
38 #include "chrome/browser/net/ssl_config_service_manager.h" | 39 #include "chrome/browser/net/ssl_config_service_manager.h" |
39 #include "chrome/browser/notifications/desktop_notification_service.h" | 40 #include "chrome/browser/notifications/desktop_notification_service.h" |
40 #include "chrome/browser/password_manager/password_store_default.h" | 41 #include "chrome/browser/password_manager/password_store_default.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 } | 397 } |
397 | 398 |
398 virtual net::SSLConfigService* GetSSLConfigService() { | 399 virtual net::SSLConfigService* GetSSLConfigService() { |
399 return profile_->GetSSLConfigService(); | 400 return profile_->GetSSLConfigService(); |
400 } | 401 } |
401 | 402 |
402 virtual HostContentSettingsMap* GetHostContentSettingsMap() { | 403 virtual HostContentSettingsMap* GetHostContentSettingsMap() { |
403 return profile_->GetHostContentSettingsMap(); | 404 return profile_->GetHostContentSettingsMap(); |
404 } | 405 } |
405 | 406 |
| 407 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { |
| 408 return profile_->GetGeolocationPermissionContext(); |
| 409 } |
| 410 |
406 virtual HostZoomMap* GetHostZoomMap() { | 411 virtual HostZoomMap* GetHostZoomMap() { |
407 return profile_->GetHostZoomMap(); | 412 return profile_->GetHostZoomMap(); |
408 } | 413 } |
409 | 414 |
410 virtual Blacklist* GetPrivacyBlacklist() { | 415 virtual Blacklist* GetPrivacyBlacklist() { |
411 return profile_->GetPrivacyBlacklist(); | 416 return profile_->GetPrivacyBlacklist(); |
412 } | 417 } |
413 | 418 |
414 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { | 419 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { |
415 return profile_->GetUserStyleSheetWatcher(); | 420 return profile_->GetUserStyleSheetWatcher(); |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { | 976 net::SSLConfigService* ProfileImpl::GetSSLConfigService() { |
972 return ssl_config_service_manager_->Get(); | 977 return ssl_config_service_manager_->Get(); |
973 } | 978 } |
974 | 979 |
975 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { | 980 HostContentSettingsMap* ProfileImpl::GetHostContentSettingsMap() { |
976 if (!host_content_settings_map_.get()) | 981 if (!host_content_settings_map_.get()) |
977 host_content_settings_map_ = new HostContentSettingsMap(this); | 982 host_content_settings_map_ = new HostContentSettingsMap(this); |
978 return host_content_settings_map_.get(); | 983 return host_content_settings_map_.get(); |
979 } | 984 } |
980 | 985 |
| 986 GeolocationPermissionContext* ProfileImpl::GetGeolocationPermissionContext() { |
| 987 if (!geolocation_permission_context_.get()) { |
| 988 geolocation_permission_context_ = |
| 989 new GeolocationPermissionContext(GetHostContentSettingsMap()); |
| 990 } |
| 991 return geolocation_permission_context_.get(); |
| 992 } |
| 993 |
981 HostZoomMap* ProfileImpl::GetHostZoomMap() { | 994 HostZoomMap* ProfileImpl::GetHostZoomMap() { |
982 if (!host_zoom_map_) | 995 if (!host_zoom_map_) |
983 host_zoom_map_ = new HostZoomMap(this); | 996 host_zoom_map_ = new HostZoomMap(this); |
984 return host_zoom_map_.get(); | 997 return host_zoom_map_.get(); |
985 } | 998 } |
986 | 999 |
987 Blacklist* ProfileImpl::GetPrivacyBlacklist() { | 1000 Blacklist* ProfileImpl::GetPrivacyBlacklist() { |
988 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 1001 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
989 switches::kEnablePrivacyBlacklists)) | 1002 switches::kEnablePrivacyBlacklists)) |
990 return NULL; | 1003 return NULL; |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 } | 1356 } |
1344 | 1357 |
1345 void ProfileImpl::InitSyncService() { | 1358 void ProfileImpl::InitSyncService() { |
1346 profile_sync_factory_.reset( | 1359 profile_sync_factory_.reset( |
1347 new ProfileSyncFactoryImpl(this, | 1360 new ProfileSyncFactoryImpl(this, |
1348 CommandLine::ForCurrentProcess())); | 1361 CommandLine::ForCurrentProcess())); |
1349 sync_service_.reset( | 1362 sync_service_.reset( |
1350 profile_sync_factory_->CreateProfileSyncService()); | 1363 profile_sync_factory_->CreateProfileSyncService()); |
1351 sync_service_->Initialize(); | 1364 sync_service_->Initialize(); |
1352 } | 1365 } |
OLD | NEW |