Commit 7dc9e3fd authored by battre@chromium.org's avatar battre@chromium.org

Don't show temporary patterns in chrome://settings/contentExceptions#zoomlevels

Scheme-and-host patterns are not persisted in the HostZoomMap and get cleared
on the next browser restart. Therefore, they are not so privacy sensitive and
don't need to be displayed in the content settings.

BUG=361575

Review URL: https://codereview.chromium.org/230503004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263078 0039d316-1c4b-4281-b951-d872f2087c98
parent 973a886c
...@@ -42,7 +42,6 @@ ...@@ -42,7 +42,6 @@
#include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/page_zoom.h" #include "content/public/common/page_zoom.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/extension_set.h" #include "extensions/common/extension_set.h"
#include "extensions/common/permissions/api_permission.h" #include "extensions/common/permissions/api_permission.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
...@@ -1006,8 +1005,8 @@ void ContentSettingsHandler::UpdateZoomLevelsExceptionsView() { ...@@ -1006,8 +1005,8 @@ void ContentSettingsHandler::UpdateZoomLevelsExceptionsView() {
exception->SetString(kOrigin, i->host); exception->SetString(kOrigin, i->host);
break; break;
case content::HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST: case content::HostZoomMap::ZOOM_CHANGED_FOR_SCHEME_AND_HOST:
exception->SetString( // These are not stored in preferences and get cleared on next browser
kOrigin, i->scheme + content::kStandardSchemeSeparator + i->host); // start. Therefore, we don't care for them.
break; break;
case content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM: case content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM:
NOTREACHED(); NOTREACHED();
...@@ -1242,17 +1241,7 @@ void ContentSettingsHandler::RemoveZoomLevelException( ...@@ -1242,17 +1241,7 @@ void ContentSettingsHandler::RemoveZoomLevelException(
content::HostZoomMap* host_zoom_map = content::HostZoomMap* host_zoom_map =
content::HostZoomMap::GetForBrowserContext(Profile::FromWebUI(web_ui())); content::HostZoomMap::GetForBrowserContext(Profile::FromWebUI(web_ui()));
double default_level = host_zoom_map->GetDefaultZoomLevel(); double default_level = host_zoom_map->GetDefaultZoomLevel();
host_zoom_map->SetZoomLevelForHost(pattern, default_level);
std::string::size_type scheme_separator_position =
pattern.find(content::kStandardSchemeSeparator);
if (scheme_separator_position == std::string::npos) {
host_zoom_map->SetZoomLevelForHost(pattern, default_level);
} else {
std::string scheme = pattern.substr(0, scheme_separator_position);
std::string host = pattern.substr(
scheme_separator_position + strlen(content::kStandardSchemeSeparator));
host_zoom_map->SetZoomLevelForHostAndScheme(scheme, host, default_level);
}
} }
void ContentSettingsHandler::RegisterMessages() { void ContentSettingsHandler::RegisterMessages() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment