Commit 1c46f7e3 authored by Anatoliy Potapchuk's avatar Anatoliy Potapchuk Committed by Commit Bot

[Kiosk] Deny permission requests to other origins but the main app

Currently we were displaying permission prompts in web kiosk mode for
origins of not the main app. To keep it consistent with other types of
kiosks, we should deny those requests.

We are not explicitly denying them, but leaving them unanswered, this
preventing them from being stored into prefs.

Bug: 1044551
Change-Id: Ic6f1a260d3f03b92fc52f8f341c6259155b791d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2014403
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#734443}
parent fd20a006
...@@ -131,6 +131,9 @@ class PermissionRequest { ...@@ -131,6 +131,9 @@ class PermissionRequest {
// It is safe for the request to be deleted at this point -- it will receive // It is safe for the request to be deleted at this point -- it will receive
// no further message from the permission request system. This method will // no further message from the permission request system. This method will
// eventually be called on every request which is not unregistered. // eventually be called on every request which is not unregistered.
// It is ok to call this method without actually resolving the request via
// PermissionGranted(), PermissionDenied() or Canceled(). However, it will not
// resolve the javascript promise from the requesting origin.
virtual void RequestFinished() = 0; virtual void RequestFinished() = 0;
// Used to record UMA metrics for permission requests. // Used to record UMA metrics for permission requests.
......
...@@ -138,9 +138,9 @@ void PermissionRequestManager::AddRequest(PermissionRequest* request) { ...@@ -138,9 +138,9 @@ void PermissionRequestManager::AddRequest(PermissionRequest* request) {
if (url::Origin::Create(request->GetOrigin()) == if (url::Origin::Create(request->GetOrigin()) ==
url::Origin::Create(app_data->install_url())) { url::Origin::Create(app_data->install_url())) {
request->PermissionGranted(); request->PermissionGranted();
request->RequestFinished();
return;
} }
request->RequestFinished();
return;
} }
#endif #endif
......
...@@ -995,9 +995,7 @@ TEST_F(PermissionRequestManagerTest, TestWebKioskModeDifferentOrigin) { ...@@ -995,9 +995,7 @@ TEST_F(PermissionRequestManagerTest, TestWebKioskModeDifferentOrigin) {
WaitForBubbleToBeShown(); WaitForBubbleToBeShown();
// It should not be granted by default. // It should not be granted by default.
EXPECT_FALSE(request->granted()); EXPECT_FALSE(request->granted());
// But you should be able to accept it. EXPECT_TRUE(request->finished());
Accept();
EXPECT_TRUE(request->granted());
} }
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
......
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