Commit d4577efd authored by koz@chromium.org's avatar koz@chromium.org

Add a section for the fullscreen JS API in the content settings page.


BUG=100292


Review URL: http://codereview.chromium.org/8585047

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110654 0039d316-1c4b-4281-b951-d872f2087c98
parent a3234e87
...@@ -6088,6 +6088,12 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -6088,6 +6088,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_INTENTS_ASK_RADIO" desc="A radio button in Content Settings dialog to configure web-intents per-site."> <message name="IDS_INTENTS_ASK_RADIO" desc="A radio button in Content Settings dialog to configure web-intents per-site.">
Ask me when a site wants to register intents (recommended) Ask me when a site wants to register intents (recommended)
</message> </message>
<message name="IDS_FULLSCREEN_TAB_LABEL" desc="Label for Fullscreen tab on Content Settings dialog">
Fullscreen
</message>
<message name="IDS_FULLSCREEN_HEADER" desc="Header for fullscreen exception management page on Content Settings dialog">
Fullscreen Exceptions
</message>
<message name="IDS_EXCEPTIONS_HOSTNAME_HEADER" desc="A column header for the hostname column of the cookie/image/javascript/plugins exceptions dialog"> <message name="IDS_EXCEPTIONS_HOSTNAME_HEADER" desc="A column header for the hostname column of the cookie/image/javascript/plugins exceptions dialog">
Site Site
</message> </message>
......
...@@ -307,6 +307,12 @@ bool HostContentSettingsMap::IsSettingAllowedForType( ...@@ -307,6 +307,12 @@ bool HostContentSettingsMap::IsSettingAllowedForType(
switches::kEnableWebIntents)) switches::kEnableWebIntents))
return false; return false;
// BLOCK semantics are not implemented for fullscreen.
if (content_type == CONTENT_SETTINGS_TYPE_FULLSCREEN &&
setting == CONTENT_SETTING_BLOCK) {
return false;
}
// DEFAULT, ALLOW and BLOCK are always allowed. // DEFAULT, ALLOW and BLOCK are always allowed.
if (setting == CONTENT_SETTING_DEFAULT || if (setting == CONTENT_SETTING_DEFAULT ||
setting == CONTENT_SETTING_ALLOW || setting == CONTENT_SETTING_ALLOW ||
...@@ -315,15 +321,15 @@ bool HostContentSettingsMap::IsSettingAllowedForType( ...@@ -315,15 +321,15 @@ bool HostContentSettingsMap::IsSettingAllowedForType(
} }
switch (content_type) { switch (content_type) {
case CONTENT_SETTINGS_TYPE_COOKIES: case CONTENT_SETTINGS_TYPE_COOKIES:
return (setting == CONTENT_SETTING_SESSION_ONLY); return setting == CONTENT_SETTING_SESSION_ONLY;
case CONTENT_SETTINGS_TYPE_PLUGINS: case CONTENT_SETTINGS_TYPE_PLUGINS:
return (setting == CONTENT_SETTING_ASK && return setting == CONTENT_SETTING_ASK &&
CommandLine::ForCurrentProcess()->HasSwitch( CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableClickToPlay)); switches::kEnableClickToPlay);
case CONTENT_SETTINGS_TYPE_GEOLOCATION: case CONTENT_SETTINGS_TYPE_GEOLOCATION:
case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
case CONTENT_SETTINGS_TYPE_INTENTS: case CONTENT_SETTINGS_TYPE_INTENTS:
return (setting == CONTENT_SETTING_ASK); return setting == CONTENT_SETTING_ASK;
default: default:
return false; return false;
} }
......
...@@ -211,6 +211,14 @@ ...@@ -211,6 +211,14 @@
i18n-content="manage_exceptions"></button> i18n-content="manage_exceptions"></button>
</div> </div>
</section> </section>
<!-- Fullscreen filter -->
<section>
<h3 i18n-content="fullscreen_tab_label"></h3>
<div>
<button class="exceptions-list-button" contentType="fullscreen"
i18n-content="manage_exceptions"></button>
</div>
</section>
<!-- Intent registration filter tab contents --> <!-- Intent registration filter tab contents -->
<if expr="pp_ifdef('enable_web_intents')"> <if expr="pp_ifdef('enable_web_intents')">
<section id="intents-section"> <section id="intents-section">
......
...@@ -59,4 +59,12 @@ ...@@ -59,4 +59,12 @@
<div contentType="intents"> <div contentType="intents">
<list mode="normal"></list> <list mode="normal"></list>
</div> </div>
<div contentType="fullscreen">
<list mode="normal"></list>
<div>
<span class="otr-explanation"
i18n-content="otr_exceptions_explanation"></span>
<list mode="otr"></list>
</div>
</div>
</div> </div>
...@@ -82,10 +82,12 @@ cr.define('options.contentSettings', function() { ...@@ -82,10 +82,12 @@ cr.define('options.contentSettings', function() {
select.appendChild(optionSession); select.appendChild(optionSession);
} }
var optionBlock = cr.doc.createElement('option'); if (this.contentType != 'fullscreen') {
optionBlock.textContent = templateData.blockException; var optionBlock = cr.doc.createElement('option');
optionBlock.value = 'block'; optionBlock.textContent = templateData.blockException;
select.appendChild(optionBlock); optionBlock.value = 'block';
select.appendChild(optionBlock);
}
this.contentElement.appendChild(select); this.contentElement.appendChild(select);
select.className = 'exception-setting'; select.className = 'exception-setting';
...@@ -428,7 +430,8 @@ cr.define('options.contentSettings', function() { ...@@ -428,7 +430,8 @@ cr.define('options.contentSettings', function() {
isEditable: function() { isEditable: function() {
// Editing notifications and geolocation is disabled for now. // Editing notifications and geolocation is disabled for now.
return !(this.contentType == 'notifications' || return !(this.contentType == 'notifications' ||
this.contentType == 'location'); this.contentType == 'location' ||
this.contentType == 'fullscreen');
}, },
/** /**
......
...@@ -263,6 +263,9 @@ void ContentSettingsHandler::GetLocalizedValues( ...@@ -263,6 +263,9 @@ void ContentSettingsHandler::GetLocalizedValues(
{ "intentsAsk", IDS_INTENTS_ASK_RADIO }, { "intentsAsk", IDS_INTENTS_ASK_RADIO },
{ "intentsBlock", IDS_INTENTS_BLOCK_RADIO }, { "intentsBlock", IDS_INTENTS_BLOCK_RADIO },
{ "intents_header", IDS_INTENTS_HEADER }, { "intents_header", IDS_INTENTS_HEADER },
// Fullscreen filter.
{ "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL },
{ "fullscreen_header", IDS_FULLSCREEN_HEADER },
}; };
RegisterStrings(localized_strings, resources, arraysize(resources)); RegisterStrings(localized_strings, resources, arraysize(resources));
...@@ -413,9 +416,6 @@ void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { ...@@ -413,9 +416,6 @@ void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() {
// for this content type and we skip it here. // for this content type and we skip it here.
if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE) if (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE)
continue; continue;
// TODO(koz): Implement fullscreen content settings UI.
if (type == CONTENT_SETTINGS_TYPE_FULLSCREEN)
continue;
// TODO(scheib): Mouse lock content settings UI. http://crbug.com/97768 // TODO(scheib): Mouse lock content settings UI. http://crbug.com/97768
if (type == CONTENT_SETTINGS_TYPE_MOUSELOCK) if (type == CONTENT_SETTINGS_TYPE_MOUSELOCK)
continue; continue;
...@@ -602,6 +602,11 @@ void ContentSettingsHandler::UpdateExceptionsViewFromHostContentSettingsMap( ...@@ -602,6 +602,11 @@ void ContentSettingsHandler::UpdateExceptionsViewFromHostContentSettingsMap(
UpdateExceptionsViewFromOTRHostContentSettingsMap(type); UpdateExceptionsViewFromOTRHostContentSettingsMap(type);
// TODO(koz): The default for fullscreen is always 'ask'.
// http://crbug.com/104683
if (type == CONTENT_SETTINGS_TYPE_FULLSCREEN)
return;
// The default may also have changed (we won't get a separate notification). // The default may also have changed (we won't get a separate notification).
// If it hasn't changed, this call will be harmless. // If it hasn't changed, this call will be harmless.
UpdateSettingDefaultFromModel(type); UpdateSettingDefaultFromModel(type);
......
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