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 || |