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

Unified Diff: chrome/renderer/extensions/extension_helper.cc

Issue 9316102: Update extension events, routing, and delivery to use user gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lint fix Created 8 years, 10 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 | « chrome/renderer/extensions/extension_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/extension_helper.cc
diff --git a/chrome/renderer/extensions/extension_helper.cc b/chrome/renderer/extensions/extension_helper.cc
index 0e33ec4a7c751cd042b2d7fe78923334f1d3133a..7c98f8746d7db48495661c08e8cca5684ccb916c 100644
--- a/chrome/renderer/extensions/extension_helper.cc
+++ b/chrome/renderer/extensions/extension_helper.cc
@@ -26,6 +26,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebConsoleMessage.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLRequest.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebScopedUserGesture.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "webkit/glue/image_resource_fetcher.h"
#include "webkit/glue/resource_fetcher.h"
@@ -36,6 +37,7 @@ using WebKit::WebConsoleMessage;
using WebKit::WebDataSource;
using WebKit::WebFrame;
using WebKit::WebURLRequest;
+using WebKit::WebScopedUserGesture;
using WebKit::WebView;
using webkit_glue::ImageResourceFetcher;
using webkit_glue::ResourceFetcher;
@@ -194,7 +196,13 @@ void ExtensionHelper::OnExtensionResponse(int request_id,
void ExtensionHelper::OnExtensionMessageInvoke(const std::string& extension_id,
const std::string& function_name,
const ListValue& args,
- const GURL& event_url) {
+ const GURL& event_url,
+ bool user_gesture) {
+ scoped_ptr<WebScopedUserGesture> web_user_gesture;
+ if (user_gesture) {
+ web_user_gesture.reset(new WebScopedUserGesture);
+ }
+
extension_dispatcher_->v8_context_set().DispatchChromeHiddenMethod(
extension_id, function_name, args, render_view(), event_url);
}
« no previous file with comments | « chrome/renderer/extensions/extension_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698