Chromium Code Reviews| Index: chrome/browser/ui/webui/options/content_settings_handler.cc |
| diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc |
| index 531952ecab655c7044bc120379e1a04836c9766c..c6d6f171f01a0a24e2d0d38eafe572b0967389ed 100644 |
| --- a/chrome/browser/ui/webui/options/content_settings_handler.cc |
| +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc |
| @@ -515,12 +515,15 @@ void ContentSettingsHandler::InitializeHandler() { |
| &ContentSettingsHandler::UpdateProtectedContentExceptionsButton, |
| base::Unretained(this))); |
| - content::HostZoomMap* host_zoom_map = |
| - content::HostZoomMap::GetForBrowserContext(context); |
| + // Here we only subscribe to the HostZoomMap for the default storage partition |
| + // since we don't allow the user to manage the zoom levels for apps. |
| + // We're only interested in zoom-levels that are persisted, since the user |
| + // is given the opportunity to view/delete these in the content-settings page. |
| host_zoom_map_subscription_ = |
| - host_zoom_map->AddZoomLevelChangedCallback( |
| - base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, |
| - base::Unretained(this))); |
| + content::HostZoomMap::GetDefaultForBrowserContext(context) |
| + ->AddZoomLevelChangedCallback( |
| + base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, |
| + base::Unretained(this))); |
|
Fady Samuel
2014/08/14 18:56:26
Is there a lifetime issue here?
wjmaclean
2014/08/14 19:12:20
I don't think so. Assuming the previous code was c
|
| flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context)); |
| } |
| @@ -999,7 +1002,8 @@ void ContentSettingsHandler::UpdateZoomLevelsExceptionsView() { |
| base::ListValue zoom_levels_exceptions; |
| content::HostZoomMap* host_zoom_map = |
| - content::HostZoomMap::GetForBrowserContext(GetBrowserContext(web_ui())); |
| + content::HostZoomMap::GetDefaultForBrowserContext( |
| + GetBrowserContext(web_ui())); |
| content::HostZoomMap::ZoomLevelVector zoom_levels( |
| host_zoom_map->GetAllZoomLevels()); |
| std::sort(zoom_levels.begin(), zoom_levels.end(), HostZoomSort); |
| @@ -1252,7 +1256,8 @@ void ContentSettingsHandler::RemoveZoomLevelException( |
| DCHECK(rv); |
| content::HostZoomMap* host_zoom_map = |
| - content::HostZoomMap::GetForBrowserContext(GetBrowserContext(web_ui())); |
| + content::HostZoomMap::GetDefaultForBrowserContext( |
| + GetBrowserContext(web_ui())); |
| double default_level = host_zoom_map->GetDefaultZoomLevel(); |
| host_zoom_map->SetZoomLevelForHost(pattern, default_level); |
| } |