| OLD | NEW | 
|---|
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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/legacy_render_widget_host_win.h" | 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" | 
| 6 | 6 | 
| 7 #include <memory> | 7 #include <memory> | 
| 8 | 8 | 
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" | 
| 10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" | 
| 11 #include "base/win/windows_version.h" | 11 #include "base/win/windows_version.h" | 
| 12 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 12 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 
| 13 #include "content/browser/accessibility/browser_accessibility_win.h" | 13 #include "content/browser/accessibility/browser_accessibility_win.h" | 
| 14 #include "content/browser/renderer_host/render_widget_host_impl.h" | 14 #include "content/browser/renderer_host/render_widget_host_impl.h" | 
| 15 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 15 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 
| 16 #include "content/public/browser/browser_accessibility_state.h" | 16 #include "content/public/browser/browser_accessibility_state.h" | 
| 17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" | 
| 18 #include "ui/base/touch/touch_enabled.h" |  | 
| 19 #include "ui/base/view_prop.h" | 18 #include "ui/base/view_prop.h" | 
| 20 #include "ui/base/win/internal_constants.h" | 19 #include "ui/base/win/internal_constants.h" | 
| 21 #include "ui/base/win/window_event_target.h" | 20 #include "ui/base/win/window_event_target.h" | 
| 22 #include "ui/display/win/screen_win.h" | 21 #include "ui/display/win/screen_win.h" | 
| 23 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" | 
| 24 #include "ui/gfx/win/direct_manipulation.h" | 23 #include "ui/gfx/win/direct_manipulation.h" | 
| 25 | 24 | 
| 26 namespace content { | 25 namespace content { | 
| 27 | 26 | 
| 28 // A custom MSAA object id used to determine if a screen reader or some | 27 // A custom MSAA object id used to determine if a screen reader or some | 
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 105   Base::Create(parent, rect, L"Chrome Legacy Window", | 104   Base::Create(parent, rect, L"Chrome Legacy Window", | 
| 106                WS_CHILDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, | 105                WS_CHILDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, | 
| 107                WS_EX_TRANSPARENT); | 106                WS_EX_TRANSPARENT); | 
| 108 } | 107 } | 
| 109 | 108 | 
| 110 LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() { | 109 LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() { | 
| 111   DCHECK(!::IsWindow(hwnd())); | 110   DCHECK(!::IsWindow(hwnd())); | 
| 112 } | 111 } | 
| 113 | 112 | 
| 114 bool LegacyRenderWidgetHostHWND::Init() { | 113 bool LegacyRenderWidgetHostHWND::Init() { | 
| 115   if (base::win::GetVersion() >= base::win::VERSION_WIN7 && | 114   if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 
| 116       ui::AreTouchEventsEnabled()) |  | 
| 117     RegisterTouchWindow(hwnd(), TWF_WANTPALM); | 115     RegisterTouchWindow(hwnd(), TWF_WANTPALM); | 
| 118 | 116 | 
| 119   HRESULT hr = ::CreateStdAccessibleObject( | 117   HRESULT hr = ::CreateStdAccessibleObject( | 
| 120       hwnd(), OBJID_WINDOW, IID_IAccessible, | 118       hwnd(), OBJID_WINDOW, IID_IAccessible, | 
| 121       reinterpret_cast<void **>(window_accessible_.Receive())); | 119       reinterpret_cast<void **>(window_accessible_.Receive())); | 
| 122   DCHECK(SUCCEEDED(hr)); | 120   DCHECK(SUCCEEDED(hr)); | 
| 123 | 121 | 
| 124   if (!BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { | 122   if (!BrowserAccessibilityState::GetInstance()->IsAccessibleBrowser()) { | 
| 125     // Attempt to detect screen readers or other clients who want full | 123     // Attempt to detect screen readers or other clients who want full | 
| 126     // accessibility support, by seeing if they respond to this event. | 124     // accessibility support, by seeing if they respond to this event. | 
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 406       direct_manipulation_helper_->Activate(hwnd()); | 404       direct_manipulation_helper_->Activate(hwnd()); | 
| 407     } else if (window_pos->flags & SWP_HIDEWINDOW) { | 405     } else if (window_pos->flags & SWP_HIDEWINDOW) { | 
| 408       direct_manipulation_helper_->Deactivate(hwnd()); | 406       direct_manipulation_helper_->Deactivate(hwnd()); | 
| 409     } | 407     } | 
| 410   } | 408   } | 
| 411   SetMsgHandled(FALSE); | 409   SetMsgHandled(FALSE); | 
| 412   return 0; | 410   return 0; | 
| 413 } | 411 } | 
| 414 | 412 | 
| 415 }  // namespace content | 413 }  // namespace content | 
| OLD | NEW | 
|---|