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