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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 393133002: Migrate HostZoomMap to live in StoragePartition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698