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_util.h" | 10 #include "base/file_util.h" |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 #if defined(OS_CHROMEOS) | 487 #if defined(OS_CHROMEOS) |
488 if (IsGuestSession()) | 488 if (IsGuestSession()) |
489 profile = new GuestSessionProfile(this); | 489 profile = new GuestSessionProfile(this); |
490 #endif | 490 #endif |
491 if (!profile) | 491 if (!profile) |
492 profile = new OffTheRecordProfileImpl(this); | 492 profile = new OffTheRecordProfileImpl(this); |
493 profile->Init(); | 493 profile->Init(); |
494 return profile; | 494 return profile; |
495 } | 495 } |
496 | 496 |
497 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { | 497 void OffTheRecordProfileImpl::OnZoomLevelChanged( |
498 if (host.empty()) | 498 const HostZoomMap::ZoomLevelChange& change) { |
499 return; | 499 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
| 500 switch (change.mode) { |
| 501 case HostZoomMap::ZOOM_CHANGED_GENERIC: |
| 502 return; |
| 503 case HostZoomMap::ZOOM_CHANGED_FOR_HOST: |
| 504 host_zoom_map->SetZoomLevelForHost(change.host, change.zoom_level); |
| 505 return; |
| 506 case HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: |
| 507 host_zoom_map->SetZoomLevelForHostAndScheme(change.scheme, |
| 508 change.host, |
| 509 change.zoom_level); |
| 510 return; |
| 511 default: |
| 512 NOTREACHED(); |
| 513 } |
500 | 514 |
501 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | |
502 HostZoomMap* parent_host_zoom_map = | |
503 HostZoomMap::GetForBrowserContext(profile_); | |
504 double level = parent_host_zoom_map->GetZoomLevel(host); | |
505 host_zoom_map->SetZoomLevel(host, level); | |
506 } | 515 } |
OLD | NEW |