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/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Clears any data the network stack contains that may be related to the | 187 // Clears any data the network stack contains that may be related to the |
188 // OTR session. | 188 // OTR session. |
189 g_browser_process->io_thread()->ChangedToOnTheRecord(); | 189 g_browser_process->io_thread()->ChangedToOnTheRecord(); |
190 } | 190 } |
191 | 191 |
192 void OffTheRecordProfileImpl::InitIoData() { | 192 void OffTheRecordProfileImpl::InitIoData() { |
193 io_data_.reset(new OffTheRecordProfileIOData::Handle(this)); | 193 io_data_.reset(new OffTheRecordProfileIOData::Handle(this)); |
194 } | 194 } |
195 | 195 |
196 void OffTheRecordProfileImpl::InitHostZoomMap() { | 196 void OffTheRecordProfileImpl::InitHostZoomMap() { |
197 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 197 HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this); |
198 HostZoomMap* parent_host_zoom_map = | 198 HostZoomMap* parent_host_zoom_map = |
199 HostZoomMap::GetForBrowserContext(profile_); | 199 HostZoomMap::GetDefaultForBrowserContext(profile_); |
200 host_zoom_map->CopyFrom(parent_host_zoom_map); | 200 host_zoom_map->CopyFrom(parent_host_zoom_map); |
201 // Observe parent's HZM change for propagating change of parent's | 201 // Observe parent's HZM change for propagating change of parent's |
202 // change to this HZM. | 202 // change to this HZM. |
203 zoom_subscription_ = parent_host_zoom_map->AddZoomLevelChangedCallback( | 203 zoom_subscription_ = parent_host_zoom_map->AddZoomLevelChangedCallback( |
204 base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged, | 204 base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged, |
205 base::Unretained(this))); | 205 base::Unretained(this))); |
206 } | 206 } |
207 | 207 |
208 #if defined(OS_ANDROID) || defined(OS_IOS) | 208 #if defined(OS_ANDROID) || defined(OS_IOS) |
209 void OffTheRecordProfileImpl::UseSystemProxy() { | 209 void OffTheRecordProfileImpl::UseSystemProxy() { |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 profile = new GuestSessionProfile(this); | 508 profile = new GuestSessionProfile(this); |
509 #endif | 509 #endif |
510 if (!profile) | 510 if (!profile) |
511 profile = new OffTheRecordProfileImpl(this); | 511 profile = new OffTheRecordProfileImpl(this); |
512 profile->Init(); | 512 profile->Init(); |
513 return profile; | 513 return profile; |
514 } | 514 } |
515 | 515 |
516 void OffTheRecordProfileImpl::OnZoomLevelChanged( | 516 void OffTheRecordProfileImpl::OnZoomLevelChanged( |
517 const HostZoomMap::ZoomLevelChange& change) { | 517 const HostZoomMap::ZoomLevelChange& change) { |
518 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | 518 HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this); |
519 switch (change.mode) { | 519 switch (change.mode) { |
520 case HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: | 520 case HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: |
521 return; | 521 return; |
522 case HostZoomMap::ZOOM_CHANGED_FOR_HOST: | 522 case HostZoomMap::ZOOM_CHANGED_FOR_HOST: |
523 host_zoom_map->SetZoomLevelForHost(change.host, change.zoom_level); | 523 host_zoom_map->SetZoomLevelForHost(change.host, change.zoom_level); |
524 return; | 524 return; |
525 case HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: | 525 case HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: |
526 host_zoom_map->SetZoomLevelForHostAndScheme(change.scheme, | 526 host_zoom_map->SetZoomLevelForHostAndScheme(change.scheme, |
527 change.host, | 527 change.host, |
528 change.zoom_level); | 528 change.zoom_level); |
529 return; | 529 return; |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { | 533 PrefProxyConfigTracker* OffTheRecordProfileImpl::CreateProxyConfigTracker() { |
534 #if defined(OS_CHROMEOS) | 534 #if defined(OS_CHROMEOS) |
535 if (chromeos::ProfileHelper::IsSigninProfile(this)) { | 535 if (chromeos::ProfileHelper::IsSigninProfile(this)) { |
536 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( | 536 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( |
537 g_browser_process->local_state()); | 537 g_browser_process->local_state()); |
538 } | 538 } |
539 #endif // defined(OS_CHROMEOS) | 539 #endif // defined(OS_CHROMEOS) |
540 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( | 540 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( |
541 GetPrefs(), g_browser_process->local_state()); | 541 GetPrefs(), g_browser_process->local_state()); |
542 } | 542 } |
OLD | NEW |