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

Side by Side Diff: ui/android/dummy_screen_android.cc

Issue 2688413007: Add display::GetDisplayNearestView (Closed)
Patch Set: add missing files Created 3 years, 10 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 "ui/android/dummy_screen_android.h" 5 #include "ui/android/dummy_screen_android.h"
6 #include "ui/display/display.h" 6 #include "ui/display/display.h"
7 #include "ui/display/screen.h" 7 #include "ui/display/screen.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 21 matching lines...) Expand all
32 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override { 32 gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override {
33 return NULL; 33 return NULL;
34 } 34 }
35 35
36 int GetNumDisplays() const override { return 1; } 36 int GetNumDisplays() const override { return 1; }
37 37
38 const std::vector<Display>& GetAllDisplays() const override { 38 const std::vector<Display>& GetAllDisplays() const override {
39 return displays_; 39 return displays_;
40 } 40 }
41 41
42 Display GetDisplayNearestWindow(gfx::NativeView view) const override { 42 Display GetDisplayNearestWindow(gfx::NativeWindow window) const override {
43 return GetPrimaryDisplay(); 43 return GetPrimaryDisplay();
44 } 44 }
45 45
46 Display GetDisplayNearestPoint(const gfx::Point& point) const override { 46 Display GetDisplayNearestPoint(const gfx::Point& point) const override {
47 return GetPrimaryDisplay(); 47 return GetPrimaryDisplay();
48 } 48 }
49 49
50 Display GetDisplayMatching(const gfx::Rect& match_rect) const override { 50 Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
51 return GetPrimaryDisplay(); 51 return GetPrimaryDisplay();
52 } 52 }
53 53
54 Display GetPrimaryDisplay() const override { return displays_[0]; } 54 Display GetPrimaryDisplay() const override { return displays_[0]; }
55 55
56 void AddObserver(DisplayObserver* observer) override {} 56 void AddObserver(DisplayObserver* observer) override {}
57 void RemoveObserver(DisplayObserver* observer) override {} 57 void RemoveObserver(DisplayObserver* observer) override {}
58 58
59 private: 59 private:
60 std::vector<Display> displays_; 60 std::vector<Display> displays_;
61 }; 61 };
62 62
63 display::Screen* CreateDummyScreenAndroid() { 63 display::Screen* CreateDummyScreenAndroid() {
64 return new DummyScreenAndroid; 64 return new DummyScreenAndroid;
65 } 65 }
66 66
67 } // namespace ui 67 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698