| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "ui/base/l10n/l10n_util_win.h" | 52 #include "ui/base/l10n/l10n_util_win.h" |
| 53 #include "ui/base/text/text_elider.h" | 53 #include "ui/base/text/text_elider.h" |
| 54 #include "ui/base/ui_base_switches.h" | 54 #include "ui/base/ui_base_switches.h" |
| 55 #include "ui/base/view_prop.h" | 55 #include "ui/base/view_prop.h" |
| 56 #include "ui/base/win/hwnd_util.h" | 56 #include "ui/base/win/hwnd_util.h" |
| 57 #include "ui/base/win/mouse_wheel_util.h" | 57 #include "ui/base/win/mouse_wheel_util.h" |
| 58 #include "ui/gfx/canvas.h" | 58 #include "ui/gfx/canvas.h" |
| 59 #include "ui/gfx/gdi_util.h" | 59 #include "ui/gfx/gdi_util.h" |
| 60 #include "ui/gfx/rect.h" | 60 #include "ui/gfx/rect.h" |
| 61 #include "ui/gfx/screen.h" | 61 #include "ui/gfx/screen.h" |
| 62 #include "webkit/glue/webaccessibility.h" | |
| 63 #include "webkit/glue/webcursor.h" | 62 #include "webkit/glue/webcursor.h" |
| 64 #include "webkit/plugins/npapi/plugin_constants_win.h" | 63 #include "webkit/plugins/npapi/plugin_constants_win.h" |
| 65 #include "webkit/plugins/npapi/webplugin.h" | 64 #include "webkit/plugins/npapi/webplugin.h" |
| 66 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" | 65 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 67 | 66 |
| 68 // From MSDN. | 67 // From MSDN. |
| 69 #define MOUSEEVENTF_FROMTOUCH 0xFF515700 | 68 #define MOUSEEVENTF_FROMTOUCH 0xFF515700 |
| 70 | 69 |
| 71 using base::TimeDelta; | 70 using base::TimeDelta; |
| 72 using base::TimeTicks; | 71 using base::TimeTicks; |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 gfx::NativeViewAccessible | 710 gfx::NativeViewAccessible |
| 712 RenderWidgetHostViewWin::GetNativeViewAccessible() { | 711 RenderWidgetHostViewWin::GetNativeViewAccessible() { |
| 713 if (render_widget_host_ && | 712 if (render_widget_host_ && |
| 714 !BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { | 713 !BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { |
| 715 // Attempt to detect screen readers by sending an event with our custom id. | 714 // Attempt to detect screen readers by sending an event with our custom id. |
| 716 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); | 715 NotifyWinEvent(EVENT_SYSTEM_ALERT, m_hWnd, kIdCustom, CHILDID_SELF); |
| 717 } | 716 } |
| 718 | 717 |
| 719 if (!GetBrowserAccessibilityManager()) { | 718 if (!GetBrowserAccessibilityManager()) { |
| 720 // Return busy document tree while renderer accessibility tree loads. | 719 // Return busy document tree while renderer accessibility tree loads. |
| 721 WebAccessibility::State busy_state = | 720 content::AccessibilityNodeData::State busy_state = |
| 722 static_cast<WebAccessibility::State>(1 << WebAccessibility::STATE_BUSY); | 721 static_cast<content::AccessibilityNodeData::State>( |
| 722 1 << content::AccessibilityNodeData::STATE_BUSY); |
| 723 SetBrowserAccessibilityManager( | 723 SetBrowserAccessibilityManager( |
| 724 BrowserAccessibilityManager::CreateEmptyDocument( | 724 BrowserAccessibilityManager::CreateEmptyDocument( |
| 725 m_hWnd, busy_state, this)); | 725 m_hWnd, busy_state, this)); |
| 726 } | 726 } |
| 727 | 727 |
| 728 return GetBrowserAccessibilityManager()->GetRoot()-> | 728 return GetBrowserAccessibilityManager()->GetRoot()-> |
| 729 ToBrowserAccessibilityWin(); | 729 ToBrowserAccessibilityWin(); |
| 730 } | 730 } |
| 731 | 731 |
| 732 void RenderWidgetHostViewWin::MovePluginWindows( | 732 void RenderWidgetHostViewWin::MovePluginWindows( |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2329 } | 2329 } |
| 2330 ::CloseGestureInfoHandle(gi_handle); | 2330 ::CloseGestureInfoHandle(gi_handle); |
| 2331 return 0; | 2331 return 0; |
| 2332 } | 2332 } |
| 2333 | 2333 |
| 2334 void RenderWidgetHostViewWin::OnAccessibilityNotifications( | 2334 void RenderWidgetHostViewWin::OnAccessibilityNotifications( |
| 2335 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 2335 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
| 2336 if (!GetBrowserAccessibilityManager()) { | 2336 if (!GetBrowserAccessibilityManager()) { |
| 2337 SetBrowserAccessibilityManager( | 2337 SetBrowserAccessibilityManager( |
| 2338 BrowserAccessibilityManager::CreateEmptyDocument( | 2338 BrowserAccessibilityManager::CreateEmptyDocument( |
| 2339 m_hWnd, static_cast<WebAccessibility::State>(0), this)); | 2339 m_hWnd, |
| 2340 static_cast<content::AccessibilityNodeData::State>(0), |
| 2341 this)); |
| 2340 } | 2342 } |
| 2341 GetBrowserAccessibilityManager()->OnAccessibilityNotifications(params); | 2343 GetBrowserAccessibilityManager()->OnAccessibilityNotifications(params); |
| 2342 } | 2344 } |
| 2343 | 2345 |
| 2344 bool RenderWidgetHostViewWin::LockMouse() { | 2346 bool RenderWidgetHostViewWin::LockMouse() { |
| 2345 if (mouse_locked_) | 2347 if (mouse_locked_) |
| 2346 return true; | 2348 return true; |
| 2347 | 2349 |
| 2348 mouse_locked_ = true; | 2350 mouse_locked_ = true; |
| 2349 | 2351 |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3038 void RenderWidgetHostViewWin::ResetPointerDownContext() { | 3040 void RenderWidgetHostViewWin::ResetPointerDownContext() { |
| 3039 // If the default focus on the page is on an edit field and we did not | 3041 // If the default focus on the page is on an edit field and we did not |
| 3040 // receive a focus change in the context of a pointer down message, it means | 3042 // receive a focus change in the context of a pointer down message, it means |
| 3041 // that the pointer down message occurred on the edit field and we should | 3043 // that the pointer down message occurred on the edit field and we should |
| 3042 // display the on screen keyboard | 3044 // display the on screen keyboard |
| 3043 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) | 3045 if (!received_focus_change_after_pointer_down_ && virtual_keyboard_) |
| 3044 DisplayOnScreenKeyboardIfNeeded(); | 3046 DisplayOnScreenKeyboardIfNeeded(); |
| 3045 received_focus_change_after_pointer_down_ = false; | 3047 received_focus_change_after_pointer_down_ = false; |
| 3046 pointer_down_context_ = false; | 3048 pointer_down_context_ = false; |
| 3047 } | 3049 } |
| OLD | NEW |