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

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

Issue 40065: RenderWidgetHost now stores both the WebKeyboardEvent and the native (Closed)
Patch Set: Redesign Created 11 years, 9 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
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "chrome/browser/renderer_host/render_widget_host_view_win.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/gfx/gdi_util.h" 8 #include "base/gfx/gdi_util.h"
9 #include "base/gfx/rect.h" 9 #include "base/gfx/rect.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
11 #include "base/win_util.h" 11 #include "base/win_util.h"
12 #include "chrome/browser/browser_accessibility.h" 12 #include "chrome/browser/browser_accessibility.h"
13 #include "chrome/browser/browser_accessibility_manager.h" 13 #include "chrome/browser/browser_accessibility_manager.h"
14 #include "chrome/browser/browser_trial.h" 14 #include "chrome/browser/browser_trial.h"
15 #include "chrome/browser/renderer_host/backing_store.h" 15 #include "chrome/browser/renderer_host/backing_store.h"
16 #include "chrome/browser/renderer_host/render_process_host.h" 16 #include "chrome/browser/renderer_host/render_process_host.h"
17 #include "chrome/browser/renderer_host/render_widget_host.h" 17 #include "chrome/browser/renderer_host/render_widget_host.h"
18 #include "chrome/common/chrome_constants.h" 18 #include "chrome/common/chrome_constants.h"
19 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
20 #include "chrome/common/gfx/chrome_canvas.h" 20 #include "chrome/common/gfx/chrome_canvas.h"
21 #include "chrome/common/l10n_util.h" 21 #include "chrome/common/l10n_util.h"
22 #include "chrome/common/l10n_util_win.h" 22 #include "chrome/common/l10n_util_win.h"
23 #include "chrome/common/native_web_keyboard_event.h"
23 #include "chrome/common/plugin_messages.h" 24 #include "chrome/common/plugin_messages.h"
24 #include "chrome/common/render_messages.h" 25 #include "chrome/common/render_messages.h"
25 #include "chrome/common/resource_bundle.h" 26 #include "chrome/common/resource_bundle.h"
26 #include "chrome/common/win_util.h" 27 #include "chrome/common/win_util.h"
27 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! 28 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h!
28 #include "chrome/views/widget_win.h" 29 #include "chrome/views/widget_win.h"
29 #include "grit/webkit_resources.h" 30 #include "grit/webkit_resources.h"
30 #include "webkit/glue/plugins/plugin_constants_win.h" 31 #include "webkit/glue/plugins/plugin_constants_win.h"
31 #include "webkit/glue/plugins/webplugin_delegate_impl.h" 32 #include "webkit/glue/plugins/webplugin_delegate_impl.h"
32 #include "webkit/glue/webcursor.h" 33 #include "webkit/glue/webcursor.h"
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 (((message == WM_KEYDOWN || message == WM_KEYUP) && (wparam == VK_TAB)) || 817 (((message == WM_KEYDOWN || message == WM_KEYUP) && (wparam == VK_TAB)) ||
817 (message == WM_CHAR && wparam == L'\t'))) { 818 (message == WM_CHAR && wparam == L'\t'))) {
818 DCHECK(parent_hwnd_); 819 DCHECK(parent_hwnd_);
819 // First close the pop-up. 820 // First close the pop-up.
820 SendMessage(WM_CANCELMODE); 821 SendMessage(WM_CANCELMODE);
821 // Then move the focus by forwarding the tab key to the parent. 822 // Then move the focus by forwarding the tab key to the parent.
822 return ::SendMessage(parent_hwnd_, message, wparam, lparam); 823 return ::SendMessage(parent_hwnd_, message, wparam, lparam);
823 } 824 }
824 825
825 render_widget_host_->ForwardKeyboardEvent( 826 render_widget_host_->ForwardKeyboardEvent(
826 WebKeyboardEvent(m_hWnd, message, wparam, lparam)); 827 NativeWebKeyboardEvent(m_hWnd, message, wparam, lparam));
827 return 0; 828 return 0;
828 } 829 }
829 830
830 LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, 831 LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam,
831 LPARAM lparam, BOOL& handled) { 832 LPARAM lparam, BOOL& handled) {
832 // Workaround for Thinkpad mousewheel driver. We get mouse wheel/scroll 833 // Workaround for Thinkpad mousewheel driver. We get mouse wheel/scroll
833 // messages even if we are not in the foreground. So here we check if 834 // messages even if we are not in the foreground. So here we check if
834 // we have any owned popup windows in the foreground and dismiss them. 835 // we have any owned popup windows in the foreground and dismiss them.
835 if (m_hWnd != GetForegroundWindow()) { 836 if (m_hWnd != GetForegroundWindow()) {
836 HWND toplevel_hwnd = ::GetAncestor(m_hWnd, GA_ROOT); 837 HWND toplevel_hwnd = ::GetAncestor(m_hWnd, GA_ROOT);
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 // WM_LBUTTONDOWN. 1035 // WM_LBUTTONDOWN.
1035 SetFocus(); 1036 SetFocus();
1036 } 1037 }
1037 } 1038 }
1038 1039
1039 void RenderWidgetHostViewWin::ShutdownHost() { 1040 void RenderWidgetHostViewWin::ShutdownHost() {
1040 shutdown_factory_.RevokeAll(); 1041 shutdown_factory_.RevokeAll();
1041 render_widget_host_->Shutdown(); 1042 render_widget_host_->Shutdown();
1042 // Do not touch any members at this point, |this| has been deleted. 1043 // Do not touch any members at this point, |this| has been deleted.
1043 } 1044 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698