| OLD | NEW |
| 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 <peninputpanel_i.c> | 8 #include <peninputpanel_i.c> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "ui/gfx/canvas.h" | 57 #include "ui/gfx/canvas.h" |
| 58 #include "ui/gfx/gdi_util.h" | 58 #include "ui/gfx/gdi_util.h" |
| 59 #include "ui/gfx/rect.h" | 59 #include "ui/gfx/rect.h" |
| 60 #include "ui/gfx/screen.h" | 60 #include "ui/gfx/screen.h" |
| 61 #include "webkit/glue/webaccessibility.h" | 61 #include "webkit/glue/webaccessibility.h" |
| 62 #include "webkit/glue/webcursor.h" | 62 #include "webkit/glue/webcursor.h" |
| 63 #include "webkit/plugins/npapi/plugin_constants_win.h" | 63 #include "webkit/plugins/npapi/plugin_constants_win.h" |
| 64 #include "webkit/plugins/npapi/webplugin.h" | 64 #include "webkit/plugins/npapi/webplugin.h" |
| 65 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 65 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 66 | 66 |
| 67 // From MSDN. |
| 68 #define MOUSEEVENTF_FROMTOUCH 0xFF515700 |
| 69 |
| 67 using base::TimeDelta; | 70 using base::TimeDelta; |
| 68 using base::TimeTicks; | 71 using base::TimeTicks; |
| 69 using content::BrowserThread; | 72 using content::BrowserThread; |
| 70 using content::NativeWebKeyboardEvent; | 73 using content::NativeWebKeyboardEvent; |
| 71 using content::RenderWidgetHost; | 74 using content::RenderWidgetHost; |
| 72 using content::RenderWidgetHostImpl; | 75 using content::RenderWidgetHostImpl; |
| 73 using content::RenderWidgetHostView; | 76 using content::RenderWidgetHostView; |
| 74 using ui::ViewProp; | 77 using ui::ViewProp; |
| 75 using WebKit::WebInputEvent; | 78 using WebKit::WebInputEvent; |
| 76 using WebKit::WebInputEventFactory; | 79 using WebKit::WebInputEventFactory; |
| (...skipping 1712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 default: | 1792 default: |
| 1790 handled = FALSE; | 1793 handled = FALSE; |
| 1791 return 0; | 1794 return 0; |
| 1792 } | 1795 } |
| 1793 } | 1796 } |
| 1794 | 1797 |
| 1795 LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam, | 1798 LRESULT RenderWidgetHostViewWin::OnMouseEvent(UINT message, WPARAM wparam, |
| 1796 LPARAM lparam, BOOL& handled) { | 1799 LPARAM lparam, BOOL& handled) { |
| 1797 handled = TRUE; | 1800 handled = TRUE; |
| 1798 | 1801 |
| 1802 // Windows sends (fake) mouse messages for touch events. Ignore these since |
| 1803 // we're processing WM_TOUCH elsewhere. |
| 1804 if (touch_events_enabled_ && |
| 1805 (message == WM_LBUTTONDOWN || message == WM_LBUTTONUP || |
| 1806 message == WM_RBUTTONDOWN || message == WM_RBUTTONUP) && |
| 1807 (GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == |
| 1808 MOUSEEVENTF_FROMTOUCH) |
| 1809 return 0; |
| 1810 |
| 1799 if (message == WM_MOUSELEAVE) | 1811 if (message == WM_MOUSELEAVE) |
| 1800 ignore_mouse_movement_ = true; | 1812 ignore_mouse_movement_ = true; |
| 1801 | 1813 |
| 1802 if (mouse_locked_) { | 1814 if (mouse_locked_) { |
| 1803 HandleLockedMouseEvent(message, wparam, lparam); | 1815 HandleLockedMouseEvent(message, wparam, lparam); |
| 1804 MoveCursorToCenterIfNecessary(); | 1816 MoveCursorToCenterIfNecessary(); |
| 1805 return 0; | 1817 return 0; |
| 1806 } | 1818 } |
| 1807 | 1819 |
| 1808 if (::IsWindow(tooltip_hwnd_)) { | 1820 if (::IsWindow(tooltip_hwnd_)) { |
| (...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3010 void RenderWidgetHostViewWin::ResetPointerDownContext() { | 3022 void RenderWidgetHostViewWin::ResetPointerDownContext() { |
| 3011 // If the default focus on the page is on an edit field and we did not | 3023 // If the default focus on the page is on an edit field and we did not |
| 3012 // receive a focus change in the context of a pointer down message, it means | 3024 // receive a focus change in the context of a pointer down message, it means |
| 3013 // that the pointer down message occurred on the edit field and we should | 3025 // that the pointer down message occurred on the edit field and we should |
| 3014 // display the on screen keyboard | 3026 // display the on screen keyboard |
| 3015 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 3027 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
| 3016 DisplayOnScreenKeyboardIfNeeded(); | 3028 DisplayOnScreenKeyboardIfNeeded(); |
| 3017 received_focus_change_after_pointer_down_ = false; | 3029 received_focus_change_after_pointer_down_ = false; |
| 3018 pointer_down_context_ = false; | 3030 pointer_down_context_ = false; |
| 3019 } | 3031 } |
| OLD | NEW |