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 30 matching lines...) Expand all Loading... |
41 #include "chrome/common/chrome_notification_types.h" | 41 #include "chrome/common/chrome_notification_types.h" |
42 #include "chrome/common/chrome_paths.h" | 42 #include "chrome/common/chrome_paths.h" |
43 #include "chrome/common/chrome_switches.h" | 43 #include "chrome/common/chrome_switches.h" |
44 #include "chrome/common/extensions/extension.h" | 44 #include "chrome/common/extensions/extension.h" |
45 #include "chrome/common/json_pref_store.h" | 45 #include "chrome/common/json_pref_store.h" |
46 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
47 #include "chrome/common/render_messages.h" | 47 #include "chrome/common/render_messages.h" |
48 #include "content/browser/appcache/chrome_appcache_service.h" | 48 #include "content/browser/appcache/chrome_appcache_service.h" |
49 #include "content/browser/chrome_blob_storage_context.h" | 49 #include "content/browser/chrome_blob_storage_context.h" |
50 #include "content/browser/file_system/browser_file_system_helper.h" | 50 #include "content/browser/file_system/browser_file_system_helper.h" |
51 #include "content/browser/host_zoom_map.h" | |
52 #include "content/browser/in_process_webkit/webkit_context.h" | 51 #include "content/browser/in_process_webkit/webkit_context.h" |
53 #include "content/browser/ssl/ssl_host_state.h" | 52 #include "content/browser/ssl/ssl_host_state.h" |
54 #include "content/public/browser/browser_thread.h" | 53 #include "content/public/browser/browser_thread.h" |
| 54 #include "content/public/browser/host_zoom_map.h" |
55 #include "content/public/browser/notification_service.h" | 55 #include "content/public/browser/notification_service.h" |
56 #include "content/public/browser/web_contents.h" | 56 #include "content/public/browser/web_contents.h" |
57 #include "net/base/transport_security_state.h" | 57 #include "net/base/transport_security_state.h" |
58 #include "net/http/http_server_properties.h" | 58 #include "net/http/http_server_properties.h" |
59 #include "webkit/database/database_tracker.h" | 59 #include "webkit/database/database_tracker.h" |
60 #include "webkit/quota/quota_manager.h" | 60 #include "webkit/quota/quota_manager.h" |
61 | 61 |
62 #if defined(OS_CHROMEOS) | 62 #if defined(OS_CHROMEOS) |
63 #include "chrome/browser/chromeos/preferences.h" | 63 #include "chrome/browser/chromeos/preferences.h" |
64 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 64 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
65 #endif | 65 #endif |
66 | 66 |
67 using content::BrowserThread; | 67 using content::BrowserThread; |
68 using content::DownloadManager; | 68 using content::DownloadManager; |
| 69 using content::HostZoomMap; |
69 | 70 |
70 namespace { | 71 namespace { |
71 | 72 |
72 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, | 73 void NotifyOTRProfileCreatedOnIOThread(void* original_profile, |
73 void* otr_profile) { | 74 void* otr_profile) { |
74 ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated( | 75 ExtensionWebRequestEventRouter::GetInstance()->OnOTRProfileCreated( |
75 original_profile, otr_profile); | 76 original_profile, otr_profile); |
76 } | 77 } |
77 | 78 |
78 void NotifyOTRProfileDestroyedOnIOThread(void* original_profile, | 79 void NotifyOTRProfileDestroyedOnIOThread(void* original_profile, |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 if (!host_content_settings_map_.get()) { | 385 if (!host_content_settings_map_.get()) { |
385 host_content_settings_map_ = new HostContentSettingsMap( | 386 host_content_settings_map_ = new HostContentSettingsMap( |
386 GetPrefs(), GetExtensionService(), true); | 387 GetPrefs(), GetExtensionService(), true); |
387 } | 388 } |
388 return host_content_settings_map_.get(); | 389 return host_content_settings_map_.get(); |
389 } | 390 } |
390 | 391 |
391 HostZoomMap* OffTheRecordProfileImpl::GetHostZoomMap() { | 392 HostZoomMap* OffTheRecordProfileImpl::GetHostZoomMap() { |
392 // Create new host zoom map and copy zoom levels from parent. | 393 // Create new host zoom map and copy zoom levels from parent. |
393 if (!host_zoom_map_) { | 394 if (!host_zoom_map_) { |
394 host_zoom_map_ = new HostZoomMap(); | 395 host_zoom_map_ = HostZoomMap::Create(); |
395 host_zoom_map_->CopyFrom(profile_->GetHostZoomMap()); | 396 host_zoom_map_->CopyFrom(profile_->GetHostZoomMap()); |
396 // Observe parent's HZM change for propagating change of parent's | 397 // Observe parent's HZM change for propagating change of parent's |
397 // change to this HZM. | 398 // change to this HZM. |
398 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, | 399 registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
399 content::Source<HostZoomMap>(profile_->GetHostZoomMap())); | 400 content::Source<HostZoomMap>(profile_->GetHostZoomMap())); |
400 } | 401 } |
401 return host_zoom_map_.get(); | 402 return host_zoom_map_.get(); |
402 } | 403 } |
403 | 404 |
404 content::GeolocationPermissionContext* | 405 content::GeolocationPermissionContext* |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 OffTheRecordProfileImpl* profile = NULL; | 645 OffTheRecordProfileImpl* profile = NULL; |
645 #if defined(OS_CHROMEOS) | 646 #if defined(OS_CHROMEOS) |
646 if (Profile::IsGuestSession()) | 647 if (Profile::IsGuestSession()) |
647 profile = new GuestSessionProfile(this); | 648 profile = new GuestSessionProfile(this); |
648 #endif | 649 #endif |
649 if (!profile) | 650 if (!profile) |
650 profile = new OffTheRecordProfileImpl(this); | 651 profile = new OffTheRecordProfileImpl(this); |
651 profile->Init(); | 652 profile->Init(); |
652 return profile; | 653 return profile; |
653 } | 654 } |
OLD | NEW |