Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: chrome/browser/profiles/off_the_record_profile_impl.cc

Issue 11866004: Add scheme to HostZoomMap (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix documentation Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698