From 2b4bab327076ffb54ccaae6264cf62d8eb0f5194 Mon Sep 17 00:00:00 2001 From: "cbentzel@chromium.org" Date: Fri, 25 Feb 2011 12:50:49 +0000 Subject: Bypass setting exceptions for CONTENT_SETTINGS_TYPE_PRERENDER. BUG=73938 TEST=Bring up content://settings with WebInspector enabled, validate that there are no console warnings. Review URL: http://codereview.chromium.org/6580033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76044 0039d316-1c4b-4281-b951-d872f2087c98 --- .../webui/options/content_settings_handler.cc | 44 +++++++++++++++------- .../webui/options/content_settings_handler.h | 3 ++ 2 files changed, 34 insertions(+), 13 deletions(-) (limited to 'chrome') diff --git a/chrome/browser/webui/options/content_settings_handler.cc b/chrome/browser/webui/options/content_settings_handler.cc index 9be48e1..a3f2418 100644 --- a/chrome/browser/webui/options/content_settings_handler.cc +++ b/chrome/browser/webui/options/content_settings_handler.cc @@ -405,24 +405,42 @@ void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { for (int type = CONTENT_SETTINGS_TYPE_DEFAULT + 1; type < CONTENT_SETTINGS_NUM_TYPES; ++type) { - if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION || - type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) { - continue; - } - - UpdateExceptionsViewFromOTRHostContentSettingsMap( - static_cast(type)); + UpdateOTRExceptionsViewFromModel(static_cast(type)); } } void ContentSettingsHandler::UpdateExceptionsViewFromModel( ContentSettingsType type) { - if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION) - UpdateGeolocationExceptionsView(); - else if (type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) - UpdateNotificationExceptionsView(); - else - UpdateExceptionsViewFromHostContentSettingsMap(type); + switch (type) { + case CONTENT_SETTINGS_TYPE_GEOLOCATION: + UpdateGeolocationExceptionsView(); + break; + case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: + UpdateNotificationExceptionsView(); + break; + case CONTENT_SETTINGS_TYPE_PRERENDER: + // Prerender is currently (02/24/2011) an experimental feature which is + // only turned on via about:flags. There is intentionally no UI in + // chrome://preferences for CONTENT_SETTINGS_TYPE_PRERENDER. + // TODO(cbentzel): Change once prerender moves out of about:flags. + break; + default: + UpdateExceptionsViewFromHostContentSettingsMap(type); + break; + } +} + +void ContentSettingsHandler::UpdateOTRExceptionsViewFromModel( + ContentSettingsType type) { + switch (type) { + case CONTENT_SETTINGS_TYPE_GEOLOCATION: + case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: + case CONTENT_SETTINGS_TYPE_PRERENDER: + break; + default: + UpdateExceptionsViewFromOTRHostContentSettingsMap(type); + break; + } } void ContentSettingsHandler::UpdateGeolocationExceptionsView() { diff --git a/chrome/browser/webui/options/content_settings_handler.h b/chrome/browser/webui/options/content_settings_handler.h index 5a3349d..7e5d72d 100644 --- a/chrome/browser/webui/options/content_settings_handler.h +++ b/chrome/browser/webui/options/content_settings_handler.h @@ -45,6 +45,9 @@ class ContentSettingsHandler : public OptionsPageUIHandler { // Clobbers and rebuilds the specific content setting type exceptions table. void UpdateExceptionsViewFromModel(ContentSettingsType type); + // Clobbers and rebuilds the specific content setting type exceptions + // OTR table. + void UpdateOTRExceptionsViewFromModel(ContentSettingsType type); // Clobbers and rebuilds all the exceptions tables in the page (both normal // and OTR tables). void UpdateAllExceptionsViewsFromModel(); -- cgit v1.1