OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // Need Win 7 headers for WM_GESTURE and ChangeWindowMessageFilterEx | 5 // Need Win 7 headers for WM_GESTURE and ChangeWindowMessageFilterEx |
6 // TODO(jschuh): See crbug.com/92941 for longterm fix. | 6 // TODO(jschuh): See crbug.com/92941 for longterm fix. |
7 #undef WINVER | 7 #undef WINVER |
8 #define WINVER _WIN32_WINNT_WIN7 | 8 #define WINVER _WIN32_WINNT_WIN7 |
9 #undef _WIN32_WINNT | 9 #undef _WIN32_WINNT |
10 #define _WIN32_WINNT _WIN32_WINNT_WIN7 | 10 #define _WIN32_WINNT _WIN32_WINNT_WIN7 |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "content/common/view_messages.h" | 39 #include "content/common/view_messages.h" |
40 #include "skia/ext/skia_utils_win.h" | 40 #include "skia/ext/skia_utils_win.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderli
ne.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/win/WebInputEventFact
ory.h" |
44 #include "ui/base/ime/composition_text.h" | 44 #include "ui/base/ime/composition_text.h" |
45 #include "ui/base/l10n/l10n_util_win.h" | 45 #include "ui/base/l10n/l10n_util_win.h" |
46 #include "ui/base/text/text_elider.h" | 46 #include "ui/base/text/text_elider.h" |
47 #include "ui/base/view_prop.h" | 47 #include "ui/base/view_prop.h" |
48 #include "ui/base/win/hwnd_util.h" | 48 #include "ui/base/win/hwnd_util.h" |
| 49 #include "ui/base/win/mouse_wheel_util.h" |
49 #include "ui/gfx/canvas.h" | 50 #include "ui/gfx/canvas.h" |
50 #include "ui/gfx/canvas_skia.h" | 51 #include "ui/gfx/canvas_skia.h" |
51 #include "ui/gfx/gdi_util.h" | 52 #include "ui/gfx/gdi_util.h" |
52 #include "ui/gfx/rect.h" | 53 #include "ui/gfx/rect.h" |
53 #include "ui/gfx/screen.h" | 54 #include "ui/gfx/screen.h" |
54 #include "views/accessibility/native_view_accessibility_win.h" | 55 #include "views/accessibility/native_view_accessibility_win.h" |
55 #include "views/focus/focus_manager.h" | 56 #include "views/focus/focus_manager.h" |
56 #include "views/focus/focus_util_win.h" | |
57 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! | 57 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! |
58 #include "views/widget/native_widget_win.h" | 58 #include "views/widget/native_widget_win.h" |
59 #include "webkit/glue/webaccessibility.h" | 59 #include "webkit/glue/webaccessibility.h" |
60 #include "webkit/glue/webcursor.h" | 60 #include "webkit/glue/webcursor.h" |
61 #include "webkit/plugins/npapi/plugin_constants_win.h" | 61 #include "webkit/plugins/npapi/plugin_constants_win.h" |
62 #include "webkit/plugins/npapi/webplugin.h" | 62 #include "webkit/plugins/npapi/webplugin.h" |
63 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 63 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
64 | 64 |
65 using base::TimeDelta; | 65 using base::TimeDelta; |
66 using base::TimeTicks; | 66 using base::TimeTicks; |
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 801 |
802 /////////////////////////////////////////////////////////////////////////////// | 802 /////////////////////////////////////////////////////////////////////////////// |
803 // RenderWidgetHostViewWin, private: | 803 // RenderWidgetHostViewWin, private: |
804 | 804 |
805 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { | 805 LRESULT RenderWidgetHostViewWin::OnCreate(CREATESTRUCT* create_struct) { |
806 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale | 806 // Call the WM_INPUTLANGCHANGE message handler to initialize the input locale |
807 // of a browser process. | 807 // of a browser process. |
808 OnInputLangChange(0, 0); | 808 OnInputLangChange(0, 0); |
809 // Marks that window as supporting mouse-wheel messages rerouting so it is | 809 // Marks that window as supporting mouse-wheel messages rerouting so it is |
810 // scrolled when under the mouse pointer even if inactive. | 810 // scrolled when under the mouse pointer even if inactive. |
811 props_.push_back(views::SetWindowSupportsRerouteMouseWheel(m_hWnd)); | 811 props_.push_back(ui::SetWindowSupportsRerouteMouseWheel(m_hWnd)); |
812 props_.push_back(new ViewProp(m_hWnd, kRenderWidgetHostViewKey, | 812 props_.push_back(new ViewProp(m_hWnd, kRenderWidgetHostViewKey, |
813 static_cast<RenderWidgetHostView*>(this))); | 813 static_cast<RenderWidgetHostView*>(this))); |
814 | 814 |
815 return 0; | 815 return 0; |
816 } | 816 } |
817 | 817 |
818 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, | 818 void RenderWidgetHostViewWin::OnActivate(UINT action, BOOL minimized, |
819 HWND window) { | 819 HWND window) { |
820 // If the container is a popup, clicking elsewhere on screen should close the | 820 // If the container is a popup, clicking elsewhere on screen should close the |
821 // popup. | 821 // popup. |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1395 NativeWebKeyboardEvent(m_hWnd, message, wparam, lparam)); | 1395 NativeWebKeyboardEvent(m_hWnd, message, wparam, lparam)); |
1396 } | 1396 } |
1397 return 0; | 1397 return 0; |
1398 } | 1398 } |
1399 | 1399 |
1400 LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, | 1400 LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, |
1401 LPARAM lparam, BOOL& handled) { | 1401 LPARAM lparam, BOOL& handled) { |
1402 // Forward the mouse-wheel message to the window under the mouse if it belongs | 1402 // Forward the mouse-wheel message to the window under the mouse if it belongs |
1403 // to us. | 1403 // to us. |
1404 if (message == WM_MOUSEWHEEL && | 1404 if (message == WM_MOUSEWHEEL && |
1405 views::RerouteMouseWheel(m_hWnd, wparam, lparam)) { | 1405 ui::RerouteMouseWheel(m_hWnd, wparam, lparam)) { |
1406 handled = TRUE; | 1406 handled = TRUE; |
1407 return 0; | 1407 return 0; |
1408 } | 1408 } |
1409 | 1409 |
1410 // Workaround for Thinkpad mousewheel driver. We get mouse wheel/scroll | 1410 // Workaround for Thinkpad mousewheel driver. We get mouse wheel/scroll |
1411 // messages even if we are not in the foreground. So here we check if | 1411 // messages even if we are not in the foreground. So here we check if |
1412 // we have any owned popup windows in the foreground and dismiss them. | 1412 // we have any owned popup windows in the foreground and dismiss them. |
1413 if (m_hWnd != GetForegroundWindow()) { | 1413 if (m_hWnd != GetForegroundWindow()) { |
1414 HWND toplevel_hwnd = ::GetAncestor(m_hWnd, GA_ROOT); | 1414 HWND toplevel_hwnd = ::GetAncestor(m_hWnd, GA_ROOT); |
1415 EnumThreadWindows( | 1415 EnumThreadWindows( |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 DWORD ex_style) { | 1854 DWORD ex_style) { |
1855 parent_hwnd_ = parent_hwnd; | 1855 parent_hwnd_ = parent_hwnd; |
1856 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); | 1856 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); |
1857 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); | 1857 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); |
1858 // To show tooltip on popup window.(e.g. title in <select>) | 1858 // To show tooltip on popup window.(e.g. title in <select>) |
1859 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. | 1859 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. |
1860 // Ensure the tooltip is created otherwise tooltips are never shown. | 1860 // Ensure the tooltip is created otherwise tooltips are never shown. |
1861 EnsureTooltip(); | 1861 EnsureTooltip(); |
1862 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); | 1862 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); |
1863 } | 1863 } |
OLD | NEW |