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/off_the_record_profile_impl.h" | 5 #include "chrome/browser/profiles/off_the_record_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/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
14 #include "base/prefs/json_pref_store.h" | 14 #include "base/prefs/json_pref_store.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/background/background_contents_service_factory.h" | 18 #include "chrome/browser/background/background_contents_service_factory.h" |
19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/clipboard/incognito_marker.h" |
20 #include "chrome/browser/content_settings/host_content_settings_map.h" | 21 #include "chrome/browser/content_settings/host_content_settings_map.h" |
21 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 22 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
22 #include "chrome/browser/download/download_service.h" | 23 #include "chrome/browser/download/download_service.h" |
23 #include "chrome/browser/download/download_service_factory.h" | 24 #include "chrome/browser/download/download_service_factory.h" |
24 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 25 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
25 #include "chrome/browser/extensions/extension_info_map.h" | 26 #include "chrome/browser/extensions/extension_info_map.h" |
26 #include "chrome/browser/extensions/extension_pref_store.h" | 27 #include "chrome/browser/extensions/extension_pref_store.h" |
27 #include "chrome/browser/extensions/extension_service.h" | 28 #include "chrome/browser/extensions/extension_service.h" |
28 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 29 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
29 #include "chrome/browser/extensions/extension_system.h" | 30 #include "chrome/browser/extensions/extension_system.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 150 |
150 if (host_content_settings_map_) | 151 if (host_content_settings_map_) |
151 host_content_settings_map_->ShutdownOnUIThread(); | 152 host_content_settings_map_->ShutdownOnUIThread(); |
152 | 153 |
153 if (pref_proxy_config_tracker_.get()) | 154 if (pref_proxy_config_tracker_.get()) |
154 pref_proxy_config_tracker_->DetachFromPrefService(); | 155 pref_proxy_config_tracker_->DetachFromPrefService(); |
155 | 156 |
156 // Clears any data the network stack contains that may be related to the | 157 // Clears any data the network stack contains that may be related to the |
157 // OTR session. | 158 // OTR session. |
158 g_browser_process->io_thread()->ChangedToOnTheRecord(); | 159 g_browser_process->io_thread()->ChangedToOnTheRecord(); |
| 160 // Clear the clipboard if current data were written from Incognito |
| 161 if (chrome::IsThisIncognitoMarkerInClipboard(this)) |
| 162 ui::Clipboard::GetForCurrentThread()->Clear(ui::Clipboard::BUFFER_STANDARD); |
159 } | 163 } |
160 | 164 |
161 void OffTheRecordProfileImpl::InitHostZoomMap() { | 165 void OffTheRecordProfileImpl::InitHostZoomMap() { |
162 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 166 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
163 HostZoomMap* parent_host_zoom_map = | 167 HostZoomMap* parent_host_zoom_map = |
164 HostZoomMap::GetForBrowserContext(profile_); | 168 HostZoomMap::GetForBrowserContext(profile_); |
165 host_zoom_map->CopyFrom(parent_host_zoom_map); | 169 host_zoom_map->CopyFrom(parent_host_zoom_map); |
166 // Observe parent's HZM change for propagating change of parent's | 170 // Observe parent's HZM change for propagating change of parent's |
167 // change to this HZM. | 171 // change to this HZM. |
168 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 172 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 OffTheRecordProfileImpl* profile = NULL; | 473 OffTheRecordProfileImpl* profile = NULL; |
470 #if defined(OS_CHROMEOS) | 474 #if defined(OS_CHROMEOS) |
471 if (IsGuestSession()) | 475 if (IsGuestSession()) |
472 profile = new GuestSessionProfile(this); | 476 profile = new GuestSessionProfile(this); |
473 #endif | 477 #endif |
474 if (!profile) | 478 if (!profile) |
475 profile = new OffTheRecordProfileImpl(this); | 479 profile = new OffTheRecordProfileImpl(this); |
476 profile->Init(); | 480 profile->Init(); |
477 return profile; | 481 return profile; |
478 } | 482 } |
OLD | NEW |