Commit 78e5247d authored by Gary Kacmarcik's avatar Gary Kacmarcik Committed by Commit Bot

Fix clipboard permission site-exception handling

Remove the "+ Add site exception" button for consistency with other
Content Settings based on origin. The current UX for this action
assumes that the site exception is host-pattern based, so the
exception is not stored/cleared correctly.

Bug: 818615, 677565
Change-Id: Id47b07ea704c4957f3bb73c2c99629021bc65bd3
Reviewed-on: https://chromium-review.googlesource.com/952574Reviewed-by: default avatarTheresa <twellington@chromium.org>
Reviewed-by: default avatarRaymes Khoury <raymes@chromium.org>
Reviewed-by: default avatarFinnur Thorarinsson <finnur@chromium.org>
Commit-Queue: Gary Kacmarcik <garykac@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542118}
parent 3c474400
...@@ -531,9 +531,9 @@ public class SingleCategoryPreferences extends PreferenceFragment ...@@ -531,9 +531,9 @@ public class SingleCategoryPreferences extends PreferenceFragment
} }
// Categories that support adding exceptions also manage the 'Add site' preference. // Categories that support adding exceptions also manage the 'Add site' preference.
// This should only be used for settings that have host-pattern based exceptions.
if (mCategory.showAutoplaySites() || mCategory.showBackgroundSyncSites() if (mCategory.showAutoplaySites() || mCategory.showBackgroundSyncSites()
|| mCategory.showJavaScriptSites() || mCategory.showSoundSites() || mCategory.showJavaScriptSites() || mCategory.showSoundSites()) {
|| mCategory.showClipboardSites()) {
if ((boolean) newValue) { if ((boolean) newValue) {
Preference addException = getPreferenceScreen().findPreference( Preference addException = getPreferenceScreen().findPreference(
ADD_EXCEPTION_KEY); ADD_EXCEPTION_KEY);
...@@ -566,10 +566,6 @@ public class SingleCategoryPreferences extends PreferenceFragment ...@@ -566,10 +566,6 @@ public class SingleCategoryPreferences extends PreferenceFragment
resource = R.string.website_settings_add_site_description_autoplay; resource = R.string.website_settings_add_site_description_autoplay;
} else if (mCategory.showBackgroundSyncSites()) { } else if (mCategory.showBackgroundSyncSites()) {
resource = R.string.website_settings_add_site_description_background_sync; resource = R.string.website_settings_add_site_description_background_sync;
} else if (mCategory.showClipboardSites()) {
resource = PrefServiceBridge.getInstance().isClipboardEnabled()
? R.string.website_settings_add_site_description_clipboard_block
: R.string.website_settings_add_site_description_clipboard_allow;
} else if (mCategory.showJavaScriptSites()) { } else if (mCategory.showJavaScriptSites()) {
resource = R.string.website_settings_add_site_description_javascript; resource = R.string.website_settings_add_site_description_javascript;
} else if (mCategory.showSoundSites()) { } else if (mCategory.showSoundSites()) {
...@@ -643,7 +639,7 @@ public class SingleCategoryPreferences extends PreferenceFragment ...@@ -643,7 +639,7 @@ public class SingleCategoryPreferences extends PreferenceFragment
if ((mCategory.showAutoplaySites() && !PrefServiceBridge.getInstance().isAutoplayEnabled()) if ((mCategory.showAutoplaySites() && !PrefServiceBridge.getInstance().isAutoplayEnabled())
|| (mCategory.showJavaScriptSites() || (mCategory.showJavaScriptSites()
&& !PrefServiceBridge.getInstance().javaScriptEnabled()) && !PrefServiceBridge.getInstance().javaScriptEnabled())
|| mCategory.showSoundSites() || mCategory.showClipboardSites() || mCategory.showSoundSites()
|| (mCategory.showBackgroundSyncSites() || (mCategory.showBackgroundSyncSites()
&& !PrefServiceBridge.getInstance().isBackgroundSyncAllowed())) { && !PrefServiceBridge.getInstance().isBackgroundSyncAllowed())) {
getPreferenceScreen().addPreference( getPreferenceScreen().addPreference(
......
...@@ -832,12 +832,6 @@ Your Google account may have other forms of browsing history like searches and a ...@@ -832,12 +832,6 @@ Your Google account may have other forms of browsing history like searches and a
<message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_BACKGROUND_SYNC" desc="The description for the allow Background Sync for website dialog."> <message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_BACKGROUND_SYNC" desc="The description for the allow Background Sync for website dialog.">
Allow Background Sync for a specific site. Allow Background Sync for a specific site.
</message> </message>
<message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_CLIPBOARD_ALLOW" desc="The description for the allow clipboard for website dialog.">
Allow clipboard read access for a specific site.
</message>
<message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_CLIPBOARD_BLOCK" desc="The description for the block clipboard for website dialog.">
Block clipboard read access for a specific site.
</message>
<message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_SOUND_ALLOW" desc="The description for the allow sound for website dialog."> <message name="IDS_WEBSITE_SETTINGS_ADD_SITE_DESCRIPTION_SOUND_ALLOW" desc="The description for the allow sound for website dialog.">
Allow sound for a specific site. Allow sound for a specific site.
</message> </message>
......
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