diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-25 12:50:49 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-25 12:50:49 +0000 |
commit | 2b4bab327076ffb54ccaae6264cf62d8eb0f5194 (patch) | |
tree | 75abd21f2b7056e11c0ce85bd72d02c4a224d58a /chrome | |
parent | 8b08a47f878f0ed77508d6c49bf4e593ea8f2bef (diff) | |
download | chromium_src-2b4bab327076ffb54ccaae6264cf62d8eb0f5194.zip chromium_src-2b4bab327076ffb54ccaae6264cf62d8eb0f5194.tar.gz chromium_src-2b4bab327076ffb54ccaae6264cf62d8eb0f5194.tar.bz2 |
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
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/webui/options/content_settings_handler.cc | 44 | ||||
-rw-r--r-- | chrome/browser/webui/options/content_settings_handler.h | 3 |
2 files changed, 34 insertions, 13 deletions
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<ContentSettingsType>(type)); + UpdateOTRExceptionsViewFromModel(static_cast<ContentSettingsType>(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(); |