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

Side by Side Diff: extensions/shell/browser/shell_screen.cc

Issue 1935083003: gfx::Screen: Replace GetWindowUnderCursor() with IsWindowUnderCursor(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Null checks Created 4 years, 7 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 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 "extensions/shell/browser/shell_screen.h" 5 #include "extensions/shell/browser/shell_screen.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 host_->window()->RemoveObserver(this); 56 host_->window()->RemoveObserver(this);
57 host_ = nullptr; 57 host_ = nullptr;
58 } 58 }
59 59
60 // display::Screen overrides: 60 // display::Screen overrides:
61 61
62 gfx::Point ShellScreen::GetCursorScreenPoint() { 62 gfx::Point ShellScreen::GetCursorScreenPoint() {
63 return aura::Env::GetInstance()->last_mouse_location(); 63 return aura::Env::GetInstance()->last_mouse_location();
64 } 64 }
65 65
66 gfx::NativeWindow ShellScreen::GetWindowUnderCursor() { 66 bool ShellScreen::IsWindowUnderCursor(gfx::NativeWindow window) {
67 return GetWindowAtScreenPoint(GetCursorScreenPoint()); 67 return GetWindowAtScreenPoint(GetCursorScreenPoint()) == window;
68 } 68 }
69 69
70 gfx::NativeWindow ShellScreen::GetWindowAtScreenPoint(const gfx::Point& point) { 70 gfx::NativeWindow ShellScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
71 return host_->window()->GetTopWindowContainingPoint(point); 71 return host_->window()->GetTopWindowContainingPoint(point);
72 } 72 }
73 73
74 int ShellScreen::GetNumDisplays() const { 74 int ShellScreen::GetNumDisplays() const {
75 return 1; 75 return 1;
76 } 76 }
77 77
(...skipping 18 matching lines...) Expand all
96 96
97 display::Display ShellScreen::GetPrimaryDisplay() const { 97 display::Display ShellScreen::GetPrimaryDisplay() const {
98 return display_; 98 return display_;
99 } 99 }
100 100
101 void ShellScreen::AddObserver(display::DisplayObserver* observer) {} 101 void ShellScreen::AddObserver(display::DisplayObserver* observer) {}
102 102
103 void ShellScreen::RemoveObserver(display::DisplayObserver* observer) {} 103 void ShellScreen::RemoveObserver(display::DisplayObserver* observer) {}
104 104
105 } // namespace extensions 105 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698