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

Unified Diff: chrome/browser/ui/views/website_settings/permission_prompt_impl.cc

Issue 2206903002: Remove default action in permission bubbles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No default Created 4 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
diff --git a/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc b/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
index b54d1f0ae556db7224f38cf14efabe77e7a21159..d25c14995ed3d1bda15863db0aa7a2a6100a7d6c 100644
--- a/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
+++ b/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
@@ -164,6 +164,7 @@ class PermissionsBubbleDialogDelegateView
bool Cancel() override;
bool Accept() override;
bool Close() override;
+ int GetDefaultDialogButton() const override;
int GetDialogButtons() const override;
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
@@ -304,6 +305,13 @@ void PermissionsBubbleDialogDelegateView::GetAccessibleState(
state->role = ui::AX_ROLE_ALERT_DIALOG;
}
+int PermissionsBubbleDialogDelegateView::GetDefaultDialogButton() const {
+ // To prevent permissions being accepted accidentally, and as a security
+ // measure against crbug.com/619429, permission prompts should not be accepted
+ // as the default action.
+ return ui::DIALOG_BUTTON_NONE;
felt 2016/08/04 00:17:29 Does this have the side effect of changing the but
benwells 2016/08/04 05:09:00 No, button ordering is controlled here: https://cs
felt 2016/08/04 23:53:29 oh!! that does have the side effect of making this
+}
+
int PermissionsBubbleDialogDelegateView::GetDialogButtons() const {
int buttons = ui::DIALOG_BUTTON_OK;
if (!multiple_requests_)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698