OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_profile_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "chrome/browser/background/background_contents_service_factory.h" | 15 #include "chrome/browser/background/background_contents_service_factory.h" |
16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
17 #include "chrome/browser/chrome_plugin_service_filter.h" | 17 #include "chrome/browser/chrome_plugin_service_filter.h" |
18 #include "chrome/browser/content_settings/host_content_settings_map.h" | 18 #include "chrome/browser/content_settings/host_content_settings_map.h" |
19 #include "chrome/browser/download/download_service.h" | 19 #include "chrome/browser/download/download_service.h" |
20 #include "chrome/browser/download/download_service_factory.h" | 20 #include "chrome/browser/download/download_service_factory.h" |
21 #include "chrome/browser/extensions/extension_info_map.h" | 21 #include "chrome/browser/extensions/extension_info_map.h" |
22 #include "chrome/browser/extensions/extension_message_service.h" | 22 #include "chrome/browser/extensions/extension_message_service.h" |
23 #include "chrome/browser/extensions/extension_pref_store.h" | 23 #include "chrome/browser/extensions/extension_pref_store.h" |
24 #include "chrome/browser/extensions/extension_process_manager.h" | 24 #include "chrome/browser/extensions/extension_process_manager.h" |
25 #include "chrome/browser/extensions/extension_service.h" | 25 #include "chrome/browser/extensions/extension_service.h" |
26 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 26 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
27 #include "chrome/browser/extensions/extension_webrequest_api.h" | 27 #include "chrome/browser/extensions/extension_webrequest_api.h" |
28 #include "chrome/browser/net/pref_proxy_config_service.h" | 28 #include "chrome/browser/net/pref_proxy_config_tracker.h" |
| 29 #include "chrome/browser/net/proxy_service_factory.h" |
29 #include "chrome/browser/plugin_prefs.h" | 30 #include "chrome/browser/plugin_prefs.h" |
30 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 31 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
31 #include "chrome/browser/prefs/pref_service.h" | 32 #include "chrome/browser/prefs/pref_service.h" |
32 #include "chrome/browser/profiles/profile_dependency_manager.h" | 33 #include "chrome/browser/profiles/profile_dependency_manager.h" |
33 #include "chrome/browser/sync/profile_sync_service.h" | 34 #include "chrome/browser/sync/profile_sync_service.h" |
34 #include "chrome/browser/themes/theme_service.h" | 35 #include "chrome/browser/themes/theme_service.h" |
35 #include "chrome/browser/transport_security_persister.h" | 36 #include "chrome/browser/transport_security_persister.h" |
36 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 37 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
37 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 38 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
38 #include "chrome/browser/ui/webui/extension_icon_source.h" | 39 #include "chrome/browser/ui/webui/extension_icon_source.h" |
(...skipping 14 matching lines...) Expand all Loading... |
53 #include "content/browser/ssl/ssl_host_state.h" | 54 #include "content/browser/ssl/ssl_host_state.h" |
54 #include "content/browser/tab_contents/tab_contents.h" | 55 #include "content/browser/tab_contents/tab_contents.h" |
55 #include "content/common/notification_service.h" | 56 #include "content/common/notification_service.h" |
56 #include "net/base/transport_security_state.h" | 57 #include "net/base/transport_security_state.h" |
57 #include "net/http/http_server_properties.h" | 58 #include "net/http/http_server_properties.h" |
58 #include "webkit/database/database_tracker.h" | 59 #include "webkit/database/database_tracker.h" |
59 #include "webkit/quota/quota_manager.h" | 60 #include "webkit/quota/quota_manager.h" |
60 | 61 |
61 #if defined(OS_CHROMEOS) | 62 #if defined(OS_CHROMEOS) |
62 #include "chrome/browser/chromeos/preferences.h" | 63 #include "chrome/browser/chromeos/preferences.h" |
| 64 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
63 #endif | 65 #endif |
64 | 66 |
65 namespace { | 67 namespace { |
66 | 68 |
67 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, | 69 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, |
68 void* otr_profile) { | 70 void* otr_profile) { |
69 ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated( | 71 ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated( |
70 original_profile, otr_profile); | 72 original_profile, otr_profile); |
71 } | 73 } |
72 | 74 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 BrowserThread::FILE, FROM_HERE, | 139 BrowserThread::FILE, FROM_HERE, |
138 NewRunnableMethod(db_tracker_.get(), | 140 NewRunnableMethod(db_tracker_.get(), |
139 &webkit_database::DatabaseTracker::Shutdown)); | 141 &webkit_database::DatabaseTracker::Shutdown)); |
140 } | 142 } |
141 | 143 |
142 BrowserList::RemoveObserver(this); | 144 BrowserList::RemoveObserver(this); |
143 | 145 |
144 if (host_content_settings_map_) | 146 if (host_content_settings_map_) |
145 host_content_settings_map_->ShutdownOnUIThread(); | 147 host_content_settings_map_->ShutdownOnUIThread(); |
146 | 148 |
147 if (pref_proxy_config_tracker_) | 149 if (pref_proxy_config_tracker_.get()) |
148 pref_proxy_config_tracker_->DetachFromPrefService(); | 150 pref_proxy_config_tracker_->DetachFromPrefService(); |
149 | 151 |
150 ExtensionService* extension_service = GetExtensionService(); | 152 ExtensionService* extension_service = GetExtensionService(); |
151 if (extension_service) { | 153 if (extension_service) { |
152 ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); | 154 ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); |
153 extension_prefs->ClearIncognitoSessionOnlyContentSettings(); | 155 extension_prefs->ClearIncognitoSessionOnlyContentSettings(); |
154 } | 156 } |
155 } | 157 } |
156 | 158 |
157 std::string OffTheRecordProfileImpl::GetProfileName() { | 159 std::string OffTheRecordProfileImpl::GetProfileName() { |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 | 543 |
542 #if defined(OS_CHROMEOS) | 544 #if defined(OS_CHROMEOS) |
543 void OffTheRecordProfileImpl::ChangeAppLocale(const std::string& locale, | 545 void OffTheRecordProfileImpl::ChangeAppLocale(const std::string& locale, |
544 AppLocaleChangedVia) { | 546 AppLocaleChangedVia) { |
545 } | 547 } |
546 | 548 |
547 void OffTheRecordProfileImpl::OnLogin() { | 549 void OffTheRecordProfileImpl::OnLogin() { |
548 } | 550 } |
549 #endif // defined(OS_CHROMEOS) | 551 #endif // defined(OS_CHROMEOS) |
550 | 552 |
| 553 #if defined(OS_CHROMEOS) |
| 554 chromeos::ProxyConfigServiceImpl* |
| 555 OffTheRecordProfileImpl::GetProxyConfigTracker() { |
| 556 #else |
551 PrefProxyConfigTracker* OffTheRecordProfileImpl::GetProxyConfigTracker() { | 557 PrefProxyConfigTracker* OffTheRecordProfileImpl::GetProxyConfigTracker() { |
552 if (!pref_proxy_config_tracker_) | 558 #endif // defined(OS_CHROMEOS) |
553 pref_proxy_config_tracker_ = new PrefProxyConfigTracker(GetPrefs()); | 559 if (!pref_proxy_config_tracker_.get()) { |
554 return pref_proxy_config_tracker_; | 560 pref_proxy_config_tracker_.reset( |
| 561 ProxyServiceFactory::CreatePrefProxyConfigTracker(GetPrefs())); |
| 562 } |
| 563 return pref_proxy_config_tracker_.get(); |
555 } | 564 } |
556 | 565 |
557 chrome_browser_net::Predictor* OffTheRecordProfileImpl::GetNetworkPredictor() { | 566 chrome_browser_net::Predictor* OffTheRecordProfileImpl::GetNetworkPredictor() { |
558 // We do not store information about websites visited in OTR profiles which | 567 // We do not store information about websites visited in OTR profiles which |
559 // is necessary for a Predictor, so we do not have a Predictor at all. | 568 // is necessary for a Predictor, so we do not have a Predictor at all. |
560 return NULL; | 569 return NULL; |
561 } | 570 } |
562 | 571 |
563 void OffTheRecordProfileImpl::ClearNetworkingHistorySince(base::Time time) { | 572 void OffTheRecordProfileImpl::ClearNetworkingHistorySince(base::Time time) { |
564 // No need to do anything here, our transport security state is read-only. | 573 // No need to do anything here, our transport security state is read-only. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 OffTheRecordProfileImpl* profile = NULL; | 654 OffTheRecordProfileImpl* profile = NULL; |
646 #if defined(OS_CHROMEOS) | 655 #if defined(OS_CHROMEOS) |
647 if (Profile::IsGuestSession()) | 656 if (Profile::IsGuestSession()) |
648 profile = new GuestSessionProfile(this); | 657 profile = new GuestSessionProfile(this); |
649 #endif | 658 #endif |
650 if (!profile) | 659 if (!profile) |
651 profile = new OffTheRecordProfileImpl(this); | 660 profile = new OffTheRecordProfileImpl(this); |
652 profile->Init(); | 661 profile->Init(); |
653 return profile; | 662 return profile; |
654 } | 663 } |
OLD | NEW |