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

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

Issue 659883002: Enable hidpi on Linux, refactor a bit on Windows to share Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants Created 6 years, 1 month 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
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "content/browser/accessibility/browser_accessibility_manager_win.h" 10 #include "content/browser/accessibility/browser_accessibility_manager_win.h"
11 #include "content/browser/accessibility/browser_accessibility_win.h" 11 #include "content/browser/accessibility/browser_accessibility_win.h"
12 #include "content/browser/renderer_host/render_widget_host_impl.h" 12 #include "content/browser/renderer_host/render_widget_host_impl.h"
13 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 13 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
14 #include "content/public/browser/browser_accessibility_state.h" 14 #include "content/public/browser/browser_accessibility_state.h"
15 #include "content/public/common/content_switches.h" 15 #include "content/public/common/content_switches.h"
16 #include "ui/base/touch/touch_enabled.h" 16 #include "ui/base/touch/touch_enabled.h"
17 #include "ui/base/view_prop.h" 17 #include "ui/base/view_prop.h"
18 #include "ui/base/win/internal_constants.h" 18 #include "ui/base/win/internal_constants.h"
19 #include "ui/base/win/window_event_target.h" 19 #include "ui/base/win/window_event_target.h"
20 #include "ui/gfx/dpi.h"
20 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
21 #include "ui/gfx/win/dpi.h"
22 22
23 namespace content { 23 namespace content {
24 24
25 // A custom MSAA object id used to determine if a screen reader or some 25 // A custom MSAA object id used to determine if a screen reader or some
26 // other client is listening on MSAA events - if so, we enable full web 26 // other client is listening on MSAA events - if so, we enable full web
27 // accessibility support. 27 // accessibility support.
28 const int kIdScreenReaderHoneyPot = 1; 28 const int kIdScreenReaderHoneyPot = 1;
29 29
30 // static 30 // static
31 LegacyRenderWidgetHostHWND* LegacyRenderWidgetHostHWND::Create( 31 LegacyRenderWidgetHostHWND* LegacyRenderWidgetHostHWND::Create(
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 void LegacyRenderWidgetHostHWND::Show() { 74 void LegacyRenderWidgetHostHWND::Show() {
75 ::ShowWindow(hwnd(), SW_SHOW); 75 ::ShowWindow(hwnd(), SW_SHOW);
76 } 76 }
77 77
78 void LegacyRenderWidgetHostHWND::Hide() { 78 void LegacyRenderWidgetHostHWND::Hide() {
79 ::ShowWindow(hwnd(), SW_HIDE); 79 ::ShowWindow(hwnd(), SW_HIDE);
80 } 80 }
81 81
82 void LegacyRenderWidgetHostHWND::SetBounds(const gfx::Rect& bounds) { 82 void LegacyRenderWidgetHostHWND::SetBounds(const gfx::Rect& bounds) {
83 gfx::Rect bounds_in_pixel = gfx::win::DIPToScreenRect(bounds); 83 gfx::Rect bounds_in_pixel = gfx::DIPToScreenRect(bounds);
84 ::SetWindowPos(hwnd(), NULL, bounds_in_pixel.x(), bounds_in_pixel.y(), 84 ::SetWindowPos(hwnd(), NULL, bounds_in_pixel.x(), bounds_in_pixel.y(),
85 bounds_in_pixel.width(), bounds_in_pixel.height(), 85 bounds_in_pixel.width(), bounds_in_pixel.height(),
86 SWP_NOREDRAW); 86 SWP_NOREDRAW);
87 } 87 }
88 88
89 void LegacyRenderWidgetHostHWND::OnFinalMessage(HWND hwnd) { 89 void LegacyRenderWidgetHostHWND::OnFinalMessage(HWND hwnd) {
90 if (host_) { 90 if (host_) {
91 host_->OnLegacyWindowDestroyed(); 91 host_->OnLegacyWindowDestroyed();
92 host_ = NULL; 92 host_ = NULL;
93 } 93 }
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // generate the legacy WM_VSCROLL/WM_HSCROLL messages. 371 // generate the legacy WM_VSCROLL/WM_HSCROLL messages.
372 // We add these styles to ensure that trackpad/trackpoint scrolling 372 // We add these styles to ensure that trackpad/trackpoint scrolling
373 // work. 373 // work.
374 long current_style = ::GetWindowLong(hwnd(), GWL_STYLE); 374 long current_style = ::GetWindowLong(hwnd(), GWL_STYLE);
375 ::SetWindowLong(hwnd(), GWL_STYLE, 375 ::SetWindowLong(hwnd(), GWL_STYLE,
376 current_style | WS_VSCROLL | WS_HSCROLL); 376 current_style | WS_VSCROLL | WS_HSCROLL);
377 return 0; 377 return 0;
378 } 378 }
379 379
380 } // namespace content 380 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698