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

Side by Side Diff: chrome/browser/ui/views/tabs/window_finder_x11.cc

Issue 2449103004: Refactor WindowFinder definition (Closed)
Patch Set: setting mus_window to null, for safety Created 4 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
« no previous file with comments | « chrome/browser/ui/views/tabs/window_finder_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/ui/views/tabs/window_finder.h" 5 #include "chrome/browser/ui/views/tabs/window_finder.h"
6 6
7 #include "chrome/browser/ui/views/tabs/window_finder_mus.h"
7 #include "ui/display/display.h" 8 #include "ui/display/display.h"
8 #include "ui/display/screen.h" 9 #include "ui/display/screen.h"
9 #include "ui/gfx/geometry/point_conversions.h" 10 #include "ui/gfx/geometry/point_conversions.h"
10 #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" 11 #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"
11 12
12 namespace { 13 namespace {
13 14
14 float GetDeviceScaleFactor() { 15 float GetDeviceScaleFactor() {
15 return display::Screen::GetScreen() 16 return display::Screen::GetScreen()
16 ->GetPrimaryDisplay() 17 ->GetPrimaryDisplay()
17 .device_scale_factor(); 18 .device_scale_factor();
18 } 19 }
19 20
20 gfx::Point DIPToPixelPoint(const gfx::Point& dip_point) { 21 gfx::Point DIPToPixelPoint(const gfx::Point& dip_point) {
21 return gfx::ScaleToFlooredPoint(dip_point, GetDeviceScaleFactor()); 22 return gfx::ScaleToFlooredPoint(dip_point, GetDeviceScaleFactor());
22 } 23 }
23 24
24 } // anonymous namespace 25 } // anonymous namespace
25 26
26 gfx::NativeWindow WindowFinder::GetLocalProcessWindowAtPoint( 27 gfx::NativeWindow WindowFinder::GetLocalProcessWindowAtPoint(
27 const gfx::Point& screen_point, 28 const gfx::Point& screen_point,
28 const std::set<gfx::NativeWindow>& ignore) { 29 const std::set<gfx::NativeWindow>& ignore) {
29 // The X11 server is the canonical state of what the window stacking order 30 gfx::NativeWindow mus_result = nullptr;
30 // is. 31 if (GetLocalProcessWindowAtPointMus(screen_point, ignore, &mus_result))
32 return mus_result;
33
34 // The X11 server is the canonical state of what the window stacking order is.
31 views::X11TopmostWindowFinder finder; 35 views::X11TopmostWindowFinder finder;
32 return finder.FindLocalProcessWindowAt(DIPToPixelPoint(screen_point), ignore); 36 return finder.FindLocalProcessWindowAt(DIPToPixelPoint(screen_point), ignore);
33 } 37 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tabs/window_finder_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698