Index: chrome/browser/profiles/off_the_record_profile_impl.cc |
=================================================================== |
--- chrome/browser/profiles/off_the_record_profile_impl.cc (revision 122827) |
+++ chrome/browser/profiles/off_the_record_profile_impl.cc (working copy) |
@@ -83,6 +83,15 @@ |
prefs_(real_profile->GetOffTheRecordPrefs()), |
ALLOW_THIS_IN_INITIALIZER_LIST(io_data_(this)), |
start_time_(Time::Now()) { |
+ // Create new host zoom map and copy zoom levels from parent. |
+ HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
+ HostZoomMap* parent_host_zoom_map = |
+ HostZoomMap::GetForBrowserContext(profile_); |
+ host_zoom_map->CopyFrom(parent_host_zoom_map); |
+ // Observe parent's HZM change for propagating change of parent's |
+ // change to this HZM. |
+ registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
+ content::Source<HostZoomMap>(parent_host_zoom_map)); |
} |
void OffTheRecordProfileImpl::Init() { |
@@ -345,19 +354,6 @@ |
return host_content_settings_map_.get(); |
} |
-HostZoomMap* OffTheRecordProfileImpl::GetHostZoomMap() { |
- // Create new host zoom map and copy zoom levels from parent. |
- if (!host_zoom_map_) { |
- host_zoom_map_ = HostZoomMap::Create(); |
- host_zoom_map_->CopyFrom(profile_->GetHostZoomMap()); |
- // Observe parent's HZM change for propagating change of parent's |
- // change to this HZM. |
- registrar_.Add(this, content::NOTIFICATION_ZOOM_LEVEL_CHANGED, |
- content::Source<HostZoomMap>(profile_->GetHostZoomMap())); |
- } |
- return host_zoom_map_.get(); |
-} |
- |
content::GeolocationPermissionContext* |
OffTheRecordProfileImpl::GetGeolocationPermissionContext() { |
return profile_->GetGeolocationPermissionContext(); |
@@ -507,8 +503,11 @@ |
const std::string& host = |
*(content::Details<const std::string>(details).ptr()); |
if (!host.empty()) { |
- double level = profile_->GetHostZoomMap()->GetZoomLevel(host); |
- GetHostZoomMap()->SetZoomLevel(host, level); |
+ HostZoomMap* host_zoom_map = HostZoomMap::GetForBrowserContext(this); |
+ HostZoomMap* parent_host_zoom_map = |
+ HostZoomMap::GetForBrowserContext(profile_); |
+ double level = parent_host_zoom_map->GetZoomLevel(host); |
+ host_zoom_map->SetZoomLevel(host, level); |
} |
} |
} |