Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: chrome/browser/ui/website_settings/permission_menu_model.cc

Issue 903683005: Always prompt for permission on fullscreen and mouse lock on file:// URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak unit test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/website_settings/permission_menu_model.cc
diff --git a/chrome/browser/ui/website_settings/permission_menu_model.cc b/chrome/browser/ui/website_settings/permission_menu_model.cc
index 7c6b450fc8bfb288405ddd78d6781be5c7c7b0d9..aec4bb63562618170ecb7972e477b52551c6e8b7 100644
--- a/chrome/browser/ui/website_settings/permission_menu_model.cc
+++ b/chrome/browser/ui/website_settings/permission_menu_model.cc
@@ -41,9 +41,19 @@ PermissionMenuModel::PermissionMenuModel(
}
AddCheckItem(CONTENT_SETTING_DEFAULT, label);
- // Media only support CONTENTE_SETTTING_ALLOW for https.
- if (permission_.type != CONTENT_SETTINGS_TYPE_MEDIASTREAM ||
- url.SchemeIsSecure()) {
+ // CONTENT_SETTING_ALLOW and CONTENT_SETTING_BLOCK are not allowed for
+ // fullscreen or mouse lock on file:// URLs, because there wouldn't be
+ // a reasonable origin with which to associate the preference.
+ // TODO(estark): Revisit this when crbug.com/455882 is fixed.
+ bool is_exclusive_access_on_file =
+ (permission_.type == CONTENT_SETTINGS_TYPE_FULLSCREEN ||
+ permission_.type == CONTENT_SETTINGS_TYPE_MOUSELOCK) &&
+ url.SchemeIsFile();
+
+ // Media only support CONTENT_SETTTING_ALLOW for https.
+ if ((permission_.type != CONTENT_SETTINGS_TYPE_MEDIASTREAM ||
+ url.SchemeIsSecure()) &&
+ !is_exclusive_access_on_file) {
label = l10n_util::GetStringUTF16(
IDS_WEBSITE_SETTINGS_MENU_ITEM_ALLOW);
AddCheckItem(CONTENT_SETTING_ALLOW, label);
@@ -55,7 +65,8 @@ PermissionMenuModel::PermissionMenuModel(
AddCheckItem(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, label);
}
- if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) {
+ if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN &&
+ !is_exclusive_access_on_file) {
label = l10n_util::GetStringUTF16(
IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK);
AddCheckItem(CONTENT_SETTING_BLOCK, label);

Powered by Google App Engine
This is Rietveld 408576698