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

Side by Side Diff: ash/mus/screen_mus.cc

Issue 2626453002: Standardize Screen::GetCursorScreenPoint() on Env::last_mouse_location (Closed)
Patch Set: explicit Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ash/mus/screen_mus.h" 5 #include "ash/mus/screen_mus.h"
6 6
7 #include "ui/aura/env.h"
7 #include "ui/aura/mus/window_tree_host_mus.h" 8 #include "ui/aura/mus/window_tree_host_mus.h"
8 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
9 10
10 namespace ash { 11 namespace ash {
11 12
12 ScreenMus::ScreenMus() = default; 13 ScreenMus::ScreenMus() = default;
13 14
14 ScreenMus::~ScreenMus() = default; 15 ScreenMus::~ScreenMus() = default;
15 16
16 display::Display ScreenMus::GetDisplayNearestWindow( 17 display::Display ScreenMus::GetDisplayNearestWindow(
17 aura::Window* window) const { 18 aura::Window* window) const {
18 const aura::WindowTreeHost* host = window->GetHost(); 19 const aura::WindowTreeHost* host = window->GetHost();
19 if (!host) 20 if (!host)
20 return GetPrimaryDisplay(); 21 return GetPrimaryDisplay();
21 auto iter = display_list().FindDisplayById( 22 auto iter = display_list().FindDisplayById(
22 static_cast<const aura::WindowTreeHostMus*>(host)->display_id()); 23 static_cast<const aura::WindowTreeHostMus*>(host)->display_id());
23 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter; 24 return iter == display_list().displays().end() ? GetPrimaryDisplay() : *iter;
24 } 25 }
25 26
27 gfx::Point ScreenMus::GetCursorScreenPoint() {
28 return aura::Env::GetInstance()->last_mouse_location();
29 }
30
26 } // namespace ash 31 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/screen_mus.h ('k') | ui/views/mus/mus_client.h » ('j') | ui/views/mus/mus_client.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698