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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 11779035: Centralize keypress listener handling in non-platform-specific code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Keep ignoring input events Created 7 years, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_win.h" 5 #include "content/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <stack> 9 #include <stack>
10 10
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 if (!capture_enter_key_) 1816 if (!capture_enter_key_)
1817 ignore_keyboard_event = true; 1817 ignore_keyboard_event = true;
1818 capture_enter_key_ = false; 1818 capture_enter_key_ = false;
1819 } else { 1819 } else {
1820 // Ignore all other keyboard events for the enter key if not captured. 1820 // Ignore all other keyboard events for the enter key if not captured.
1821 if (!capture_enter_key_) 1821 if (!capture_enter_key_)
1822 ignore_keyboard_event = true; 1822 ignore_keyboard_event = true;
1823 } 1823 }
1824 } 1824 }
1825 1825
1826 MSG msg = { m_hWnd, message, wparam, lparam }; 1826 if (render_widget_host_ && !ignore_keyboard_event) {
1827 ui::KeyEvent key_event(msg, message == WM_CHAR); 1827 MSG msg = { m_hWnd, message, wparam, lparam };
1828 if (render_widget_host_ &&
1829 render_widget_host_->KeyPressListenersHandleEvent(
1830 NativeWebKeyboardEvent(msg)))
1831 return 0;
1832
1833 if (render_widget_host_ && !ignore_keyboard_event)
1834 render_widget_host_->ForwardKeyboardEvent(NativeWebKeyboardEvent(msg)); 1828 render_widget_host_->ForwardKeyboardEvent(NativeWebKeyboardEvent(msg));
1829 }
1835 1830
1836 return 0; 1831 return 0;
1837 } 1832 }
1838 1833
1839 LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, 1834 LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam,
1840 LPARAM lparam, BOOL& handled) { 1835 LPARAM lparam, BOOL& handled) {
1841 TRACE_EVENT0("browser", "RenderWidgetHostViewWin::OnWheelEvent"); 1836 TRACE_EVENT0("browser", "RenderWidgetHostViewWin::OnWheelEvent");
1842 // Forward the mouse-wheel message to the window under the mouse if it belongs 1837 // Forward the mouse-wheel message to the window under the mouse if it belongs
1843 // to us. 1838 // to us.
1844 if (message == WM_MOUSEWHEEL && 1839 if (message == WM_MOUSEWHEEL &&
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
2996 //////////////////////////////////////////////////////////////////////////////// 2991 ////////////////////////////////////////////////////////////////////////////////
2997 // RenderWidgetHostView, public: 2992 // RenderWidgetHostView, public:
2998 2993
2999 // static 2994 // static
3000 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( 2995 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
3001 RenderWidgetHost* widget) { 2996 RenderWidgetHost* widget) {
3002 return new RenderWidgetHostViewWin(widget); 2997 return new RenderWidgetHostViewWin(widget);
3003 } 2998 }
3004 2999
3005 } // namespace content 3000 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698