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 |
11 #include <windows.h> | 11 #include <windows.h> |
12 | 12 |
13 #include "content/browser/renderer_host/render_widget_host_view_win.h" | 13 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
14 | 14 |
15 #include <algorithm> | 15 #include <algorithm> |
16 | 16 |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/i18n/rtl.h" | 18 #include "base/i18n/rtl.h" |
19 #include "base/metrics/histogram.h" | 19 #include "base/metrics/histogram.h" |
20 #include "base/process_util.h" | 20 #include "base/process_util.h" |
21 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
22 #include "base/win/scoped_comptr.h" | 22 #include "base/win/scoped_comptr.h" |
23 #include "base/win/scoped_gdi_object.h" | 23 #include "base/win/scoped_gdi_object.h" |
| 24 #include "base/win/win_util.h" |
24 #include "base/win/wrapped_window_proc.h" | 25 #include "base/win/wrapped_window_proc.h" |
25 #include "content/browser/accessibility/browser_accessibility_manager.h" | 26 #include "content/browser/accessibility/browser_accessibility_manager.h" |
26 #include "content/browser/accessibility/browser_accessibility_state.h" | 27 #include "content/browser/accessibility/browser_accessibility_state.h" |
27 #include "content/browser/accessibility/browser_accessibility_win.h" | 28 #include "content/browser/accessibility/browser_accessibility_win.h" |
28 #include "content/browser/browser_thread.h" | 29 #include "content/browser/browser_thread.h" |
29 #include "content/browser/content_browser_client.h" | 30 #include "content/browser/content_browser_client.h" |
30 #include "content/browser/plugin_process_host.h" | 31 #include "content/browser/plugin_process_host.h" |
31 #include "content/browser/renderer_host/backing_store.h" | 32 #include "content/browser/renderer_host/backing_store.h" |
32 #include "content/browser/renderer_host/backing_store_win.h" | 33 #include "content/browser/renderer_host/backing_store_win.h" |
33 #include "content/browser/renderer_host/render_process_host.h" | 34 #include "content/browser/renderer_host/render_process_host.h" |
(...skipping 10 matching lines...) Expand all Loading... |
44 #include "ui/base/ime/composition_text.h" | 45 #include "ui/base/ime/composition_text.h" |
45 #include "ui/base/l10n/l10n_util_win.h" | 46 #include "ui/base/l10n/l10n_util_win.h" |
46 #include "ui/base/text/text_elider.h" | 47 #include "ui/base/text/text_elider.h" |
47 #include "ui/base/view_prop.h" | 48 #include "ui/base/view_prop.h" |
48 #include "ui/base/win/hwnd_util.h" | 49 #include "ui/base/win/hwnd_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/focus/focus_manager.h" | 55 #include "views/focus/focus_manager.h" |
56 #include "views/focus/focus_util_win.h" | 56 #include "views/focus/focus_util_win.h" |
57 // Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! | 57 #include "views/widget/widget.h" |
58 #include "views/widget/native_widget_win.h" | |
59 #include "webkit/glue/webaccessibility.h" | 58 #include "webkit/glue/webaccessibility.h" |
60 #include "webkit/glue/webcursor.h" | 59 #include "webkit/glue/webcursor.h" |
61 #include "webkit/plugins/npapi/plugin_constants_win.h" | 60 #include "webkit/plugins/npapi/plugin_constants_win.h" |
62 #include "webkit/plugins/npapi/webplugin.h" | 61 #include "webkit/plugins/npapi/webplugin.h" |
63 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 62 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
64 | 63 |
65 using base::TimeDelta; | 64 using base::TimeDelta; |
66 using base::TimeTicks; | 65 using base::TimeTicks; |
67 using ui::ViewProp; | 66 using ui::ViewProp; |
68 using WebKit::WebInputEvent; | 67 using WebKit::WebInputEvent; |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 // Use a special reflected message to break recursion. If we send | 1424 // Use a special reflected message to break recursion. If we send |
1426 // WM_MOUSEWHEEL, the focus manager subclass of web contents will | 1425 // WM_MOUSEWHEEL, the focus manager subclass of web contents will |
1427 // route it back here. | 1426 // route it back here. |
1428 MSG new_message = {0}; | 1427 MSG new_message = {0}; |
1429 new_message.hwnd = m_hWnd; | 1428 new_message.hwnd = m_hWnd; |
1430 new_message.message = message; | 1429 new_message.message = message; |
1431 new_message.wParam = wparam; | 1430 new_message.wParam = wparam; |
1432 new_message.lParam = lparam; | 1431 new_message.lParam = lparam; |
1433 | 1432 |
1434 handled_by_TabContents = | 1433 handled_by_TabContents = |
1435 !!::SendMessage(GetParent(), views::kReflectedMessage, 0, | 1434 !!::SendMessage(GetParent(), base::win::kReflectedMessage, 0, |
1436 reinterpret_cast<LPARAM>(&new_message)); | 1435 reinterpret_cast<LPARAM>(&new_message)); |
1437 } | 1436 } |
1438 | 1437 |
1439 if (!handled_by_TabContents && render_widget_host_) { | 1438 if (!handled_by_TabContents && render_widget_host_) { |
1440 render_widget_host_->ForwardWheelEvent( | 1439 render_widget_host_->ForwardWheelEvent( |
1441 WebInputEventFactory::mouseWheelEvent(m_hWnd, message, wparam, | 1440 WebInputEventFactory::mouseWheelEvent(m_hWnd, message, wparam, |
1442 lparam)); | 1441 lparam)); |
1443 } | 1442 } |
1444 handled = TRUE; | 1443 handled = TRUE; |
1445 return 0; | 1444 return 0; |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 DWORD ex_style) { | 1853 DWORD ex_style) { |
1855 parent_hwnd_ = parent_hwnd; | 1854 parent_hwnd_ = parent_hwnd; |
1856 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); | 1855 Create(parent_hwnd_, NULL, NULL, WS_POPUP, ex_style); |
1857 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); | 1856 MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE); |
1858 // To show tooltip on popup window.(e.g. title in <select>) | 1857 // To show tooltip on popup window.(e.g. title in <select>) |
1859 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. | 1858 // Popups default to showing, which means |DidBecomeSelected()| isn't invoked. |
1860 // Ensure the tooltip is created otherwise tooltips are never shown. | 1859 // Ensure the tooltip is created otherwise tooltips are never shown. |
1861 EnsureTooltip(); | 1860 EnsureTooltip(); |
1862 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); | 1861 ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA); |
1863 } | 1862 } |
OLD | NEW |