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_util.h" | 10 #include "base/file_util.h" |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 465 #if defined(OS_CHROMEOS) | 465 #if defined(OS_CHROMEOS) |
| 466 if (IsGuestSession()) | 466 if (IsGuestSession()) |
| 467 profile = new GuestSessionProfile(this); | 467 profile = new GuestSessionProfile(this); |
| 468 #endif | 468 #endif |
| 469 if (!profile) | 469 if (!profile) |
| 470 profile = new OffTheRecordProfileImpl(this); | 470 profile = new OffTheRecordProfileImpl(this); |
| 471 profile->Init(); | 471 profile->Init(); |
| 472 return profile; | 472 return profile; |
| 473 } | 473 } |
| 474 | 474 |
| 475 void OffTheRecordProfileImpl::OnZoomLevelChanged(const std::string& host) { | 475 void OffTheRecordProfileImpl::OnZoomLevelChanged( |
| 476 if (host.empty()) | 476 const HostZoomMap::ZoomLevelChange& change) { |
| 477 return; | 477 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
| 478 switch (change.mode) { | |
| 479 case HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: | |
| 480 return; | |
| 481 case HostZoomMap::ZOOM_CHANGED_FOR_HOST: | |
| 482 host_zoom_map->SetZoomLevelForHost(change.host, change.zoom_level); | |
| 483 return; | |
| 484 case HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: | |
| 485 host_zoom_map->SetZoomLevelForHostAndScheme(change.scheme, | |
| 486 change.host, | |
| 487 change.zoom_level); | |
| 488 return; | |
| 489 default: | |
|
sky
2013/03/07 15:47:03
Remove default so that we get compile time error i
| |
| 490 NOTREACHED(); | |
| 491 } | |
| 478 | 492 |
| 479 HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); | |
| 480 HostZoomMap* parent_host_zoom_map = | |
| 481 HostZoomMap::GetForBrowserContext(profile_); | |
| 482 double level = parent_host_zoom_map->GetZoomLevel(host); | |
| 483 host_zoom_map->SetZoomLevel(host, level); | |
| 484 } | 493 } |
| OLD | NEW |