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

Unified Diff: chrome/renderer/render_view.cc

Issue 3156016: Making window.focus()/blur() work only when user initiated (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix Linux compile Created 10 years, 4 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/render_view.h ('k') | chrome/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index d3b8b8bb09d73bdf69b55fa624dfeba44f822b50..dbc930e6ecaef21b0c1e275d8451379436ccbb4e 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2205,6 +2205,24 @@ void RenderView::didAcceptAutocompleteSuggestion(
// WebKit::WebWidgetClient ----------------------------------------------------
+void RenderView::didFocus() {
+ // TODO(jcivelli): when https://bugs.webkit.org/show_bug.cgi?id=33389 is fixed
+ // we won't have to test for user gesture anymore and we can
+ // move that code back to render_widget.cc
+ if (webview() && webview()->mainFrame() &&
+ webview()->mainFrame()->isProcessingUserGesture()) {
+ Send(new ViewHostMsg_Focus(routing_id_));
+ }
+}
+
+void RenderView::didBlur() {
+ // TODO(jcivelli): see TODO above in didFocus().
+ if (webview() && webview()->mainFrame() &&
+ webview()->mainFrame()->isProcessingUserGesture()) {
+ Send(new ViewHostMsg_Blur(routing_id_));
+ }
+}
+
// We are supposed to get a single call to Show for a newly created RenderView
// that was created via RenderView::CreateWebView. So, we wait until this
// point to dispatch the ShowView message.
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698