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

Unified Diff: chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.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: Updated Mac UI for fullscreen on file:// URLs 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/exclusive_access/exclusive_access_bubble_type.cc
diff --git a/chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc b/chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc
index 3b5dfc1664bdb885ad5de5e8bdb1bb32a1a3d5b2..20de7b412ca2593051342b102a4be18762f06e00 100644
--- a/chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc
+++ b/chrome/browser/ui/exclusive_access/exclusive_access_bubble_type.cc
@@ -107,6 +107,34 @@ base::string16 GetDenyButtonTextForType(ExclusiveAccessBubbleType type) {
}
}
+base::string16 GetAllowButtonTextForType(ExclusiveAccessBubbleType type,
+ const GURL& url) {
+ switch (type) {
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_BUTTONS:
+ // Show a Dismiss button instead of Allow for file:// URLs; on
+ // file:// URLs, the preference is not saved for the origin, so
+ // the user is opting to just Dismiss the dialog rather than Allow
+ // future fullscreen attempts.
+ if (url.SchemeIsFile()) {
msw 2015/02/12 00:07:59 nit: remove curly braces.
estark 2015/02/12 02:33:10 Done.
+ return l10n_util::GetStringUTF16(IDS_FULLSCREEN_DISMISS);
+ }
+ return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW);
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS:
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_BUTTONS:
+ return l10n_util::GetStringUTF16(IDS_FULLSCREEN_ALLOW);
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_EXIT_INSTRUCTION:
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_EXIT_INSTRUCTION:
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_MOUSELOCK_EXIT_INSTRUCTION:
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION:
+ case EXCLUSIVE_ACCESS_BUBBLE_TYPE_EXTENSION_FULLSCREEN_EXIT_INSTRUCTION:
+ NOTREACHED(); // No button in this case.
+ return base::string16();
+ default:
msw 2015/02/12 00:07:59 nit: Remove the default case (and move the NOTREAC
estark 2015/02/12 02:33:10 Done.
+ NOTREACHED();
+ return base::string16();
+ }
+}
+
bool ShowButtonsForType(ExclusiveAccessBubbleType type) {
return type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_BUTTONS ||
type == EXCLUSIVE_ACCESS_BUBBLE_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS ||

Powered by Google App Engine
This is Rietveld 408576698