| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 40 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 41 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" | 41 #include "chrome/browser/ui/zoom/chrome_zoom_level_otr_delegate.h" |
| 42 #include "chrome/common/chrome_constants.h" | 42 #include "chrome/common/chrome_constants.h" |
| 43 #include "chrome/common/chrome_paths.h" | 43 #include "chrome/common/chrome_paths.h" |
| 44 #include "chrome/common/chrome_switches.h" | 44 #include "chrome/common/chrome_switches.h" |
| 45 #include "components/content_settings/core/browser/host_content_settings_map.h" | 45 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 46 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 46 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 47 #include "components/prefs/json_pref_store.h" | 47 #include "components/prefs/json_pref_store.h" |
| 48 #include "components/proxy_config/pref_proxy_config_tracker.h" | 48 #include "components/proxy_config/pref_proxy_config_tracker.h" |
| 49 #include "components/syncable_prefs/pref_service_syncable.h" | 49 #include "components/syncable_prefs/pref_service_syncable.h" |
| 50 #include "components/ui/zoom/zoom_event_manager.h" | |
| 51 #include "components/user_prefs/user_prefs.h" | 50 #include "components/user_prefs/user_prefs.h" |
| 51 #include "components/zoom/zoom_event_manager.h" |
| 52 #include "content/public/browser/browser_thread.h" | 52 #include "content/public/browser/browser_thread.h" |
| 53 #include "content/public/browser/host_zoom_map.h" | 53 #include "content/public/browser/host_zoom_map.h" |
| 54 #include "content/public/browser/render_process_host.h" | 54 #include "content/public/browser/render_process_host.h" |
| 55 #include "content/public/browser/storage_partition.h" | 55 #include "content/public/browser/storage_partition.h" |
| 56 #include "content/public/browser/url_data_source.h" | 56 #include "content/public/browser/url_data_source.h" |
| 57 #include "content/public/browser/web_contents.h" | 57 #include "content/public/browser/web_contents.h" |
| 58 #include "net/http/http_server_properties.h" | 58 #include "net/http/http_server_properties.h" |
| 59 #include "net/http/transport_security_state.h" | 59 #include "net/http/transport_security_state.h" |
| 60 #include "storage/browser/database/database_tracker.h" | 60 #include "storage/browser/database/database_tracker.h" |
| 61 | 61 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 } | 237 } |
| 238 | 238 |
| 239 base::FilePath OffTheRecordProfileImpl::GetPath() const { | 239 base::FilePath OffTheRecordProfileImpl::GetPath() const { |
| 240 return profile_->GetPath(); | 240 return profile_->GetPath(); |
| 241 } | 241 } |
| 242 | 242 |
| 243 std::unique_ptr<content::ZoomLevelDelegate> | 243 std::unique_ptr<content::ZoomLevelDelegate> |
| 244 OffTheRecordProfileImpl::CreateZoomLevelDelegate( | 244 OffTheRecordProfileImpl::CreateZoomLevelDelegate( |
| 245 const base::FilePath& partition_path) { | 245 const base::FilePath& partition_path) { |
| 246 return base::WrapUnique(new ChromeZoomLevelOTRDelegate( | 246 return base::WrapUnique(new ChromeZoomLevelOTRDelegate( |
| 247 ui_zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); | 247 zoom::ZoomEventManager::GetForBrowserContext(this)->GetWeakPtr())); |
| 248 } | 248 } |
| 249 | 249 |
| 250 scoped_refptr<base::SequencedTaskRunner> | 250 scoped_refptr<base::SequencedTaskRunner> |
| 251 OffTheRecordProfileImpl::GetIOTaskRunner() { | 251 OffTheRecordProfileImpl::GetIOTaskRunner() { |
| 252 return profile_->GetIOTaskRunner(); | 252 return profile_->GetIOTaskRunner(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool OffTheRecordProfileImpl::IsOffTheRecord() const { | 255 bool OffTheRecordProfileImpl::IsOffTheRecord() const { |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 } | 534 } |
| 535 } | 535 } |
| 536 | 536 |
| 537 void OffTheRecordProfileImpl::UpdateDefaultZoomLevel() { | 537 void OffTheRecordProfileImpl::UpdateDefaultZoomLevel() { |
| 538 HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this); | 538 HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this); |
| 539 double default_zoom_level = | 539 double default_zoom_level = |
| 540 profile_->GetZoomLevelPrefs()->GetDefaultZoomLevelPref(); | 540 profile_->GetZoomLevelPrefs()->GetDefaultZoomLevelPref(); |
| 541 host_zoom_map->SetDefaultZoomLevel(default_zoom_level); | 541 host_zoom_map->SetDefaultZoomLevel(default_zoom_level); |
| 542 // HostZoomMap does not trigger zoom notification events when the default | 542 // HostZoomMap does not trigger zoom notification events when the default |
| 543 // zoom level is set, so we need to do it here. | 543 // zoom level is set, so we need to do it here. |
| 544 ui_zoom::ZoomEventManager::GetForBrowserContext(this) | 544 zoom::ZoomEventManager::GetForBrowserContext(this) |
| 545 ->OnDefaultZoomLevelChanged(); | 545 ->OnDefaultZoomLevelChanged(); |
| 546 } | 546 } |
| 547 | 547 |
| 548 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 548 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
| 549 #if defined(OS_CHROMEOS) | 549 #if defined(OS_CHROMEOS) |
| 550 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 550 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
| 551 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 551 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
| 552 g_browser_process->local_state()); | 552 g_browser_process->local_state()); |
| 553 } | 553 } |
| 554 #endif // defined(OS_CHROMEOS) | 554 #endif // defined(OS_CHROMEOS) |
| 555 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 555 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
| 556 GetPrefs(), g_browser_process->local_state()); | 556 GetPrefs(), g_browser_process->local_state()); |
| 557 } | 557 } |
| OLD | NEW |