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/env_var.h" | 10 #include "base/env_var.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "chrome/browser/history/history.h" | 40 #include "chrome/browser/history/history.h" |
41 #include "chrome/browser/history/top_sites.h" | 41 #include "chrome/browser/history/top_sites.h" |
42 #include "chrome/browser/host_content_settings_map.h" | 42 #include "chrome/browser/host_content_settings_map.h" |
43 #include "chrome/browser/host_zoom_map.h" | 43 #include "chrome/browser/host_zoom_map.h" |
44 #include "chrome/browser/in_process_webkit/webkit_context.h" | 44 #include "chrome/browser/in_process_webkit/webkit_context.h" |
45 #include "chrome/browser/net/chrome_url_request_context.h" | 45 #include "chrome/browser/net/chrome_url_request_context.h" |
46 #include "chrome/browser/net/ssl_config_service_manager.h" | 46 #include "chrome/browser/net/ssl_config_service_manager.h" |
47 #include "chrome/browser/notifications/desktop_notification_service.h" | 47 #include "chrome/browser/notifications/desktop_notification_service.h" |
48 #include "chrome/browser/password_manager/password_store_default.h" | 48 #include "chrome/browser/password_manager/password_store_default.h" |
49 #include "chrome/browser/pref_value_store.h" | 49 #include "chrome/browser/pref_value_store.h" |
50 #include "chrome/browser/privacy_blacklist/blacklist.h" | |
51 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 50 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
52 #include "chrome/browser/profile_manager.h" | 51 #include "chrome/browser/profile_manager.h" |
53 #include "chrome/browser/renderer_host/render_process_host.h" | 52 #include "chrome/browser/renderer_host/render_process_host.h" |
54 #include "chrome/browser/search_engines/template_url_fetcher.h" | 53 #include "chrome/browser/search_engines/template_url_fetcher.h" |
55 #include "chrome/browser/search_engines/template_url_model.h" | 54 #include "chrome/browser/search_engines/template_url_model.h" |
56 #include "chrome/browser/sessions/session_service.h" | 55 #include "chrome/browser/sessions/session_service.h" |
57 #include "chrome/browser/sessions/tab_restore_service.h" | 56 #include "chrome/browser/sessions/tab_restore_service.h" |
58 #include "chrome/browser/ssl/ssl_host_state.h" | 57 #include "chrome/browser/ssl/ssl_host_state.h" |
59 #include "chrome/browser/sync/profile_sync_service.h" | 58 #include "chrome/browser/sync/profile_sync_service.h" |
60 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 59 #include "chrome/browser/sync/profile_sync_factory_impl.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 } | 538 } |
540 | 539 |
541 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() { | 540 virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() { |
542 return profile_->GetGeolocationContentSettingsMap(); | 541 return profile_->GetGeolocationContentSettingsMap(); |
543 } | 542 } |
544 | 543 |
545 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { | 544 virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { |
546 return profile_->GetGeolocationPermissionContext(); | 545 return profile_->GetGeolocationPermissionContext(); |
547 } | 546 } |
548 | 547 |
549 virtual Blacklist* GetPrivacyBlacklist() { | |
550 return profile_->GetPrivacyBlacklist(); | |
551 } | |
552 | |
553 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { | 548 virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { |
554 return profile_->GetUserStyleSheetWatcher(); | 549 return profile_->GetUserStyleSheetWatcher(); |
555 } | 550 } |
556 | 551 |
557 virtual FindBarState* GetFindBarState() { | 552 virtual FindBarState* GetFindBarState() { |
558 if (!find_bar_state_.get()) | 553 if (!find_bar_state_.get()) |
559 find_bar_state_.reset(new FindBarState()); | 554 find_bar_state_.reset(new FindBarState()); |
560 return find_bar_state_.get(); | 555 return find_bar_state_.get(); |
561 } | 556 } |
562 | 557 |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 geolocation_content_settings_map_ = new GeolocationContentSettingsMap(this); | 1242 geolocation_content_settings_map_ = new GeolocationContentSettingsMap(this); |
1248 return geolocation_content_settings_map_.get(); | 1243 return geolocation_content_settings_map_.get(); |
1249 } | 1244 } |
1250 | 1245 |
1251 GeolocationPermissionContext* ProfileImpl::GetGeolocationPermissionContext() { | 1246 GeolocationPermissionContext* ProfileImpl::GetGeolocationPermissionContext() { |
1252 if (!geolocation_permission_context_.get()) | 1247 if (!geolocation_permission_context_.get()) |
1253 geolocation_permission_context_ = new GeolocationPermissionContext(this); | 1248 geolocation_permission_context_ = new GeolocationPermissionContext(this); |
1254 return geolocation_permission_context_.get(); | 1249 return geolocation_permission_context_.get(); |
1255 } | 1250 } |
1256 | 1251 |
1257 Blacklist* ProfileImpl::GetPrivacyBlacklist() { | |
1258 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
1259 switches::kEnablePrivacyBlacklists)) | |
1260 return NULL; | |
1261 if (!privacy_blacklist_.get()) | |
1262 privacy_blacklist_ = new Blacklist(GetPrefs()); | |
1263 return privacy_blacklist_.get(); | |
1264 } | |
1265 | |
1266 UserStyleSheetWatcher* ProfileImpl::GetUserStyleSheetWatcher() { | 1252 UserStyleSheetWatcher* ProfileImpl::GetUserStyleSheetWatcher() { |
1267 if (!user_style_sheet_watcher_.get()) { | 1253 if (!user_style_sheet_watcher_.get()) { |
1268 user_style_sheet_watcher_ = new UserStyleSheetWatcher(GetPath()); | 1254 user_style_sheet_watcher_ = new UserStyleSheetWatcher(GetPath()); |
1269 user_style_sheet_watcher_->Init(); | 1255 user_style_sheet_watcher_->Init(); |
1270 } | 1256 } |
1271 return user_style_sheet_watcher_.get(); | 1257 return user_style_sheet_watcher_.get(); |
1272 } | 1258 } |
1273 | 1259 |
1274 FindBarState* ProfileImpl::GetFindBarState() { | 1260 FindBarState* ProfileImpl::GetFindBarState() { |
1275 if (!find_bar_state_.get()) { | 1261 if (!find_bar_state_.get()) { |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1683 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1669 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
1684 sync_service_.reset( | 1670 sync_service_.reset( |
1685 profile_sync_factory_->CreateProfileSyncService()); | 1671 profile_sync_factory_->CreateProfileSyncService()); |
1686 sync_service_->Initialize(); | 1672 sync_service_->Initialize(); |
1687 } | 1673 } |
1688 | 1674 |
1689 void ProfileImpl::InitCloudPrintProxyService() { | 1675 void ProfileImpl::InitCloudPrintProxyService() { |
1690 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); | 1676 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); |
1691 cloud_print_proxy_service_->Initialize(); | 1677 cloud_print_proxy_service_->Initialize(); |
1692 } | 1678 } |
OLD | NEW |