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

Side by Side Diff: ui/gfx/screen_win.cc

Issue 341763002: Ensure that mouse events on Windows reposted by the menu_controller are converted to pixel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.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) 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 "ui/gfx/screen_win.h" 5 #include "ui/gfx/screen_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); 69 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels);
70 } 70 }
71 71
72 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() { 72 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() {
73 POINT cursor_loc; 73 POINT cursor_loc;
74 HWND hwnd = GetCursorPos(&cursor_loc) ? WindowFromPoint(cursor_loc) : NULL; 74 HWND hwnd = GetCursorPos(&cursor_loc) ? WindowFromPoint(cursor_loc) : NULL;
75 return GetNativeWindowFromHWND(hwnd); 75 return GetNativeWindowFromHWND(hwnd);
76 } 76 }
77 77
78 gfx::NativeWindow ScreenWin::GetWindowAtScreenPoint(const gfx::Point& point) { 78 gfx::NativeWindow ScreenWin::GetWindowAtScreenPoint(const gfx::Point& point) {
79 return GetNativeWindowFromHWND(WindowFromPoint(point.ToPOINT())); 79 gfx::Point point_in_pixels = gfx::win::DIPToScreenPoint(point);
80 return GetNativeWindowFromHWND(WindowFromPoint(point_in_pixels.ToPOINT()));
80 } 81 }
81 82
82 int ScreenWin::GetNumDisplays() const { 83 int ScreenWin::GetNumDisplays() const {
83 return GetSystemMetrics(SM_CMONITORS); 84 return GetSystemMetrics(SM_CMONITORS);
84 } 85 }
85 86
86 std::vector<gfx::Display> ScreenWin::GetAllDisplays() const { 87 std::vector<gfx::Display> ScreenWin::GetAllDisplays() const {
87 std::vector<gfx::Display> all_displays; 88 std::vector<gfx::Display> all_displays;
88 EnumDisplayMonitors(NULL, NULL, EnumMonitorCallback, 89 EnumDisplayMonitors(NULL, NULL, EnumMonitorCallback,
89 reinterpret_cast<LPARAM>(&all_displays)); 90 reinterpret_cast<LPARAM>(&all_displays));
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 NOTREACHED(); 151 NOTREACHED();
151 return NULL; 152 return NULL;
152 } 153 }
153 154
154 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { 155 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const {
155 NOTREACHED(); 156 NOTREACHED();
156 return NULL; 157 return NULL;
157 } 158 }
158 159
159 } // namespace gfx 160 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698