Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: content/browser/renderer_host/legacy_render_widget_host_win.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Various nits Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/metrics/drive_metrics_provider_win.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <objbase.h> 7 #include <objbase.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/command_line.h" 12 #include "base/command_line.h"
13 #include "base/win/win_util.h" 13 #include "base/win/win_util.h"
14 #include "base/win/windows_version.h"
15 #include "content/browser/accessibility/browser_accessibility_manager_win.h" 14 #include "content/browser/accessibility/browser_accessibility_manager_win.h"
16 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 15 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
17 #include "content/browser/accessibility/browser_accessibility_win.h" 16 #include "content/browser/accessibility/browser_accessibility_win.h"
18 #include "content/browser/renderer_host/render_widget_host_impl.h" 17 #include "content/browser/renderer_host/render_widget_host_impl.h"
19 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 18 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
20 #include "content/public/common/content_switches.h" 19 #include "content/public/common/content_switches.h"
21 #include "ui/accessibility/platform/ax_fake_caret_win.h" 20 #include "ui/accessibility/platform/ax_fake_caret_win.h"
22 #include "ui/base/view_prop.h" 21 #include "ui/base/view_prop.h"
23 #include "ui/base/win/internal_constants.h" 22 #include "ui/base/win/internal_constants.h"
24 #include "ui/base/win/window_event_target.h" 23 #include "ui/base/win/window_event_target.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // assistive software that makes use of a fake caret is classified as a screen 115 // assistive software that makes use of a fake caret is classified as a screen
117 // reader, e.g. the built-in Windows Magnifier. 116 // reader, e.g. the built-in Windows Magnifier.
118 ax_fake_caret_ = std::make_unique<ui::AXFakeCaretWin>(hwnd()); 117 ax_fake_caret_ = std::make_unique<ui::AXFakeCaretWin>(hwnd());
119 } 118 }
120 119
121 LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() { 120 LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() {
122 DCHECK(!::IsWindow(hwnd())); 121 DCHECK(!::IsWindow(hwnd()));
123 } 122 }
124 123
125 bool LegacyRenderWidgetHostHWND::Init() { 124 bool LegacyRenderWidgetHostHWND::Init() {
126 if (base::win::GetVersion() >= base::win::VERSION_WIN7) 125 RegisterTouchWindow(hwnd(), TWF_WANTPALM);
127 RegisterTouchWindow(hwnd(), TWF_WANTPALM);
128 126
129 HRESULT hr = ::CreateStdAccessibleObject(hwnd(), OBJID_WINDOW, 127 HRESULT hr = ::CreateStdAccessibleObject(hwnd(), OBJID_WINDOW,
130 IID_PPV_ARGS(&window_accessible_)); 128 IID_PPV_ARGS(&window_accessible_));
131 DCHECK(SUCCEEDED(hr)); 129 DCHECK(SUCCEEDED(hr));
132 130
133 AccessibilityMode mode = 131 AccessibilityMode mode =
134 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); 132 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode();
135 if (!mode.has_mode(AccessibilityMode::kNativeAPIs)) { 133 if (!mode.has_mode(AccessibilityMode::kNativeAPIs)) {
136 // Attempt to detect screen readers or other clients who want full 134 // Attempt to detect screen readers or other clients who want full
137 // accessibility support, by seeing if they respond to this event. 135 // accessibility support, by seeing if they respond to this event.
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 direct_manipulation_helper_->Activate(hwnd()); 442 direct_manipulation_helper_->Activate(hwnd());
445 } else if (window_pos->flags & SWP_HIDEWINDOW) { 443 } else if (window_pos->flags & SWP_HIDEWINDOW) {
446 direct_manipulation_helper_->Deactivate(hwnd()); 444 direct_manipulation_helper_->Deactivate(hwnd());
447 } 445 }
448 } 446 }
449 SetMsgHandled(FALSE); 447 SetMsgHandled(FALSE);
450 return 0; 448 return 0;
451 } 449 }
452 450
453 } // namespace content 451 } // namespace content
OLDNEW
« no previous file with comments | « components/metrics/drive_metrics_provider_win.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698