Commit aceb9ee1 authored by xhwang's avatar xhwang Committed by Commit bot

Update comments on pressing Esc on PlatformVerificationDialog

On the latest build pressing Esc on PlatformVerificationDialog will call
Close() instead of Cancel(). So it seems issue 467155 is fixed. Updating
comments to reflect the current state.

Also update comments in DialogDelegate.

TBR=dkrahn@chromium.org
BUG=467155,590960
TEST=No functionality change.

Review-Url: https://codereview.chromium.org/2395133003
Cr-Commit-Position: refs/heads/master@{#423744}
parent e2ea1d09
......@@ -87,22 +87,21 @@ PlatformVerificationDialog::PlatformVerificationDialog(
}
bool PlatformVerificationDialog::Cancel() {
// This method is called when user clicked "Disable on <origin>" button or
// when user pressed the "Esc" key. See http://crbug.com/467155
// This method is called when user clicked "Block" button.
callback_.Run(CONSENT_RESPONSE_DENY);
return true;
}
bool PlatformVerificationDialog::Accept() {
// This method is called when user clicked "OK, I got it" button.
// This method is called when user clicked "Allow" button.
callback_.Run(CONSENT_RESPONSE_ALLOW);
return true;
}
bool PlatformVerificationDialog::Close() {
// This method is called when user clicked "x" to dismiss the dialog, the
// permission request is canceled, or when the tab containing this dialog is
// closed.
// This method is called when user clicked "x" or pressed "Esc" to dismiss the
// dialog, the permission request is canceled, or when the tab containing this
// dialog is closed.
callback_.Run(CONSENT_RESPONSE_NONE);
return true;
}
......
......@@ -206,6 +206,7 @@ void ProtectedMediaIdentifierPermissionContext::
bool persist = false; // Whether the ContentSetting should be saved.
switch (response) {
case PlatformVerificationDialog::CONSENT_RESPONSE_NONE:
VLOG(1) << "Platform verification dismissed by user.";
content_setting = CONTENT_SETTING_ASK;
persist = false;
break;
......
......@@ -63,7 +63,7 @@ class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
virtual View* CreateFootnoteView();
// For Dialog boxes, if there is a "Cancel" button or no dialog button at all,
// this is called when the user presses the "Cancel" button or the Esc key.
// this is called when the user presses the "Cancel" button.
// It can also be called on a close action if |Close| has not been
// overridden. This function should return true if the window can be closed
// after it returns, or false if it must remain open.
......@@ -76,10 +76,11 @@ class VIEWS_EXPORT DialogDelegate : public ui::DialogModel,
virtual bool Accept();
// Called when the user closes the window without selecting an option,
// e.g. by pressing the close button on the window or using a window manager
// gesture. By default, this calls Accept() if the only button in the dialog
// is Accept, Cancel() otherwise. This function should return true if the
// window can be closed after it returns, or false if it must remain open.
// e.g. by pressing the close button on the window, pressing the Esc key, or
// using a window manager gesture. By default, this calls Accept() if the only
// button in the dialog is Accept, Cancel() otherwise. This function should
// return true if the window can be closed after it returns, or false if it
// must remain open.
virtual bool Close();
// Updates the properties and appearance of |button| which has been created
......
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