diff options
author | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 22:04:58 +0000 |
---|---|---|
committer | johnnyg@chromium.org <johnnyg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-13 22:04:58 +0000 |
commit | 4440a58b8f7658021f9badf5d5e142fc61f288c6 (patch) | |
tree | 9ba043ce2dc73dbc36cdfb2e5d8c9e23343bdf0d /chrome/renderer/notification_provider.cc | |
parent | 5ccaa41d72d5241e76bad7f16c3e0147d990584b (diff) | |
download | chromium_src-4440a58b8f7658021f9badf5d5e142fc61f288c6.zip chromium_src-4440a58b8f7658021f9badf5d5e142fc61f288c6.tar.gz chromium_src-4440a58b8f7658021f9badf5d5e142fc61f288c6.tar.bz2 |
Notifications permission infobar should only be shown in response to a user gesture, not arbitrary script.
Experimental fix for UI test, so checking in flaky at first to see if I have it...
BUG=27215
TEST=included
Committed as r31839... and reverted.
Review URL: http://codereview.chromium.org/387011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/notification_provider.cc')
-rw-r--r-- | chrome/renderer/notification_provider.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/chrome/renderer/notification_provider.cc b/chrome/renderer/notification_provider.cc index 9510cab..6746350 100644 --- a/chrome/renderer/notification_provider.cc +++ b/chrome/renderer/notification_provider.cc @@ -55,6 +55,10 @@ WebNotificationPresenter::Permission NotificationProvider::checkPermission( void NotificationProvider::requestPermission( const WebString& origin, WebNotificationPermissionCallback* callback) { + // We only request permission in response to a user gesture. + if (!view_->webview()->mainFrame()->isProcessingUserGesture()) + return; + int id = manager_.RegisterPermissionRequest(callback); Send(new ViewHostMsg_RequestNotificationPermission(view_->routing_id(), |