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

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: Rebase to 291677. 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 898cf5a14936f91673116c931004a70d1d218a9a..fb02fd457f8b1235eb756a928410abfdb20218c4 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -481,12 +481,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)));
flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context));
observer_.Add(Profile::FromWebUI(web_ui())->GetHostContentSettingsMap());
@@ -961,7 +964,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);
@@ -1214,7 +1218,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