Commit f4b67d7f authored by scheib@chromium.org's avatar scheib@chromium.org

Content settings UI for mouse lock

BUG=97768
TEST=Preferences / Under the hood / Content Settings / Mouse Lock should exist and function similar to Location


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111395 0039d316-1c4b-4281-b951-d872f2087c98
parent 7559e78b
...@@ -6142,6 +6142,21 @@ Keep your key file in a safe place. You will need it to create new versions of y ...@@ -6142,6 +6142,21 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_EXCEPTIONS_GEOLOCATION_EMBEDDED_ANY_OTHER" desc="A child row in the Geolocation Exceptions page view. Sets the default permission for the parent page when embedded on any other site."> <message name="IDS_EXCEPTIONS_GEOLOCATION_EMBEDDED_ANY_OTHER" desc="A child row in the Geolocation Exceptions page view. Sets the default permission for the parent page when embedded on any other site.">
embedded on any other site embedded on any other site
</message> </message>
<message name="IDS_MOUSE_LOCK_TAB_LABEL" desc="Label for Mouse Lock tab on Content Settings dialog">
Mouse Cursor
</message>
<message name="IDS_MOUSE_LOCK_HEADER" desc="Label for Mouse Lock exception management page on Content Settings dialog">
Mouse Cursor Exceptions
</message>
<message name="IDS_MOUSE_LOCK_ALLOW_RADIO" desc="A radio button in the Content Settings dialog for allowing all sites ability to hide the mouse cursor.">
Allow all sites to hide the mouse cursor
</message>
<message name="IDS_MOUSE_LOCK_ASK_RADIO" desc="A radio button in the Content Settings dialog for asking before allowing sites to hide the mouse cursor.">
Ask me when a site tries to hide the mouse cursor (recommended)
</message>
<message name="IDS_MOUSE_LOCK_BLOCK_RADIO" desc="A radio button in the Content Settings dialog for blocking all sites ability to hide the mouse cursor.">
Do not allow any site to hide the mouse cursor
</message>
<if expr="pp_ifdef('use_titlecase')"> <if expr="pp_ifdef('use_titlecase')">
<message name="IDS_EXCEPTIONS_MANAGE" desc="The label on the button that launches the exceptions management page for a given content type"> <message name="IDS_EXCEPTIONS_MANAGE" desc="The label on the button that launches the exceptions management page for a given content type">
......
...@@ -332,6 +332,7 @@ bool HostContentSettingsMap::IsSettingAllowedForType( ...@@ -332,6 +332,7 @@ bool HostContentSettingsMap::IsSettingAllowedForType(
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:
case CONTENT_SETTINGS_TYPE_MOUSELOCK:
return setting == CONTENT_SETTING_ASK; return setting == CONTENT_SETTING_ASK;
default: default:
return false; return false;
......
...@@ -219,6 +219,32 @@ ...@@ -219,6 +219,32 @@
i18n-content="manage_exceptions"></button> i18n-content="manage_exceptions"></button>
</div> </div>
</section> </section>
<!-- Mouse Lock filter -->
<section>
<h3 i18n-content="mouselock_tab_label"></h3>
<div>
<div class="radio">
<label>
<input type="radio" name="mouselock" value="allow">
<span i18n-content="mouselock_allow"></span>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="mouselock" value="ask">
<span i18n-content="mouselock_ask"></span>
</label>
</div>
<div class="radio">
<label>
<input type="radio" name="mouselock" value="block">
<span i18n-content="mouselock_block"></span>
</label>
</div>
<button class="exceptions-list-button" contentType="mouselock"
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">
......
...@@ -67,4 +67,7 @@ ...@@ -67,4 +67,7 @@
<list mode="otr"></list> <list mode="otr"></list>
</div> </div>
</div> </div>
<div contentType="mouselock">
<list mode="normal"></list>
</div>
</div> </div>
...@@ -266,6 +266,12 @@ void ContentSettingsHandler::GetLocalizedValues( ...@@ -266,6 +266,12 @@ void ContentSettingsHandler::GetLocalizedValues(
// Fullscreen filter. // Fullscreen filter.
{ "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL }, { "fullscreen_tab_label", IDS_FULLSCREEN_TAB_LABEL },
{ "fullscreen_header", IDS_FULLSCREEN_HEADER }, { "fullscreen_header", IDS_FULLSCREEN_HEADER },
// Mouse Lock filter.
{ "mouselock_tab_label", IDS_MOUSE_LOCK_TAB_LABEL },
{ "mouselock_header", IDS_MOUSE_LOCK_HEADER },
{ "mouselock_allow", IDS_MOUSE_LOCK_ALLOW_RADIO },
{ "mouselock_ask", IDS_MOUSE_LOCK_ASK_RADIO },
{ "mouselock_block", IDS_MOUSE_LOCK_BLOCK_RADIO },
}; };
RegisterStrings(localized_strings, resources, arraysize(resources)); RegisterStrings(localized_strings, resources, arraysize(resources));
...@@ -416,9 +422,6 @@ void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() { ...@@ -416,9 +422,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(scheib): Mouse lock content settings UI. http://crbug.com/97768
if (type == CONTENT_SETTINGS_TYPE_MOUSELOCK)
continue;
UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(type)); UpdateExceptionsViewFromModel(static_cast<ContentSettingsType>(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