Chromium Code Reviews| 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" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 #include "chrome/browser/themes/theme_service.h" | 37 #include "chrome/browser/themes/theme_service.h" |
| 38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 38 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 39 #include "chrome/common/chrome_constants.h" | 39 #include "chrome/common/chrome_constants.h" |
| 40 #include "chrome/common/chrome_paths.h" | 40 #include "chrome/common/chrome_paths.h" |
| 41 #include "chrome/common/chrome_switches.h" | 41 #include "chrome/common/chrome_switches.h" |
| 42 #include "chrome/common/extensions/extension.h" | 42 #include "chrome/common/extensions/extension.h" |
| 43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/common/render_messages.h" | 44 #include "chrome/common/render_messages.h" |
| 45 #include "content/public/browser/browser_thread.h" | 45 #include "content/public/browser/browser_thread.h" |
| 46 #include "content/public/browser/host_zoom_map.h" | 46 #include "content/public/browser/host_zoom_map.h" |
| 47 #include "content/public/browser/incognito_marker.h" | |
| 47 #include "content/public/browser/notification_service.h" | 48 #include "content/public/browser/notification_service.h" |
| 48 #include "content/public/browser/notification_types.h" | 49 #include "content/public/browser/notification_types.h" |
| 49 #include "content/public/browser/render_process_host.h" | 50 #include "content/public/browser/render_process_host.h" |
| 50 #include "content/public/browser/storage_partition.h" | 51 #include "content/public/browser/storage_partition.h" |
| 51 #include "content/public/browser/url_data_source.h" | 52 #include "content/public/browser/url_data_source.h" |
| 52 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
| 53 #include "net/base/transport_security_state.h" | 54 #include "net/base/transport_security_state.h" |
| 54 #include "net/http/http_server_properties.h" | 55 #include "net/http/http_server_properties.h" |
| 55 #include "webkit/database/database_tracker.h" | 56 #include "webkit/database/database_tracker.h" |
| 56 | 57 |
| (...skipping 92 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 (content::IsThisIncognitoMarkerInClipboard(this)) | |
|
jam
2013/02/04 16:01:59
this should be handled inside the content layer. o
| |
| 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 |