| Index: chrome/browser/profiles/off_the_record_profile_impl.cc
|
| diff --git a/chrome/browser/profiles/off_the_record_profile_impl.cc b/chrome/browser/profiles/off_the_record_profile_impl.cc
|
| index 3e6d87222f3672c024501be00ddaee67cc82e5f7..8321910ae3b6d68e02b396cb18ace1852f0320b7 100644
|
| --- a/chrome/browser/profiles/off_the_record_profile_impl.cc
|
| +++ b/chrome/browser/profiles/off_the_record_profile_impl.cc
|
| @@ -142,7 +142,7 @@ void OffTheRecordProfileImpl::Init() {
|
| GetRequestContext();
|
| #endif // defined(OS_CHROMEOS)
|
|
|
| - InitHostZoomMap();
|
| + TrackZoomLevelsFromParent();
|
|
|
| #if defined(ENABLE_PLUGINS)
|
| ChromePluginServiceFilter::GetInstance()->RegisterResourceContext(
|
| @@ -198,15 +198,20 @@ void OffTheRecordProfileImpl::InitIoData() {
|
| io_data_.reset(new OffTheRecordProfileIOData::Handle(this));
|
| }
|
|
|
| -void OffTheRecordProfileImpl::InitHostZoomMap() {
|
| +void OffTheRecordProfileImpl::TrackZoomLevelsFromParent() {
|
| + DCHECK_NE(profile_->GetProfileType(), INCOGNITO_PROFILE);
|
| +
|
| + // Here we only want to use zoom levels stored in the main-context's default
|
| + // storage partition. We're not interested in zoom levels in special
|
| + // partitions, e.g. those used by WebViewGuests.
|
| HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this);
|
| HostZoomMap* parent_host_zoom_map =
|
| HostZoomMap::GetDefaultForBrowserContext(profile_);
|
| host_zoom_map->CopyFrom(parent_host_zoom_map);
|
| - // Observe parent's HZM change for propagating change of parent's
|
| - // change to this HZM.
|
| - zoom_subscription_ = parent_host_zoom_map->AddZoomLevelChangedCallback(
|
| - base::Bind(&OffTheRecordProfileImpl::OnZoomLevelChanged,
|
| + // Observe parent profile's HostZoomMap changes so they can also be applied
|
| + // to this profile's HostZoomMap.
|
| + track_zoom_subscription_ = parent_host_zoom_map->AddZoomLevelChangedCallback(
|
| + base::Bind(&OffTheRecordProfileImpl::OnParentZoomLevelChanged,
|
| base::Unretained(this)));
|
| }
|
|
|
| @@ -227,6 +232,12 @@ base::FilePath OffTheRecordProfileImpl::GetPath() const {
|
| return profile_->GetPath();
|
| }
|
|
|
| +scoped_ptr<content::ZoomLevelDelegate>
|
| +OffTheRecordProfileImpl::CreateZoomLevelDelegate(
|
| + const base::FilePath& partition_path) {
|
| + return scoped_ptr<content::ZoomLevelDelegate>();
|
| +}
|
| +
|
| scoped_refptr<base::SequencedTaskRunner>
|
| OffTheRecordProfileImpl::GetIOTaskRunner() {
|
| return profile_->GetIOTaskRunner();
|
| @@ -513,7 +524,7 @@ Profile* Profile::CreateOffTheRecordProfile() {
|
| return profile;
|
| }
|
|
|
| -void OffTheRecordProfileImpl::OnZoomLevelChanged(
|
| +void OffTheRecordProfileImpl::OnParentZoomLevelChanged(
|
| const HostZoomMap::ZoomLevelChange& change) {
|
| HostZoomMap* host_zoom_map = HostZoomMap::GetDefaultForBrowserContext(this);
|
| switch (change.mode) {
|
|
|