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

Side by Side Diff: ui/display/android/screen_android.cc

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: id Created 4 years, 2 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 (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/display/screen.h" 5 #include "ui/display/screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/display/display.h" 9 #include "ui/display/display.h"
10 #include "ui/gfx/android/device_display_info.h" 10 #include "ui/gfx/android/device_display_info.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 Display GetDisplayNearestPoint(const gfx::Point& point) const override { 60 Display GetDisplayNearestPoint(const gfx::Point& point) const override {
61 return GetPrimaryDisplay(); 61 return GetPrimaryDisplay();
62 } 62 }
63 63
64 int GetNumDisplays() const override { return 1; } 64 int GetNumDisplays() const override { return 1; }
65 65
66 std::vector<Display> GetAllDisplays() const override { 66 std::vector<Display> GetAllDisplays() const override {
67 return std::vector<Display>(1, GetPrimaryDisplay()); 67 return std::vector<Display>(1, GetPrimaryDisplay());
68 } 68 }
69 69
70 bool GetDisplayWithDisplayId(int64_t display_id,
71 Display* display) const override {
72 if (display_id == 0) {
73 *display = GetPrimaryDisplay();
74 return true;
75 }
76 return false;
77 }
78
70 Display GetDisplayMatching(const gfx::Rect& match_rect) const override { 79 Display GetDisplayMatching(const gfx::Rect& match_rect) const override {
71 return GetPrimaryDisplay(); 80 return GetPrimaryDisplay();
72 } 81 }
73 82
74 void AddObserver(DisplayObserver* observer) override { 83 void AddObserver(DisplayObserver* observer) override {
75 // no display change on Android. 84 // no display change on Android.
76 } 85 }
77 86
78 void RemoveObserver(DisplayObserver* observer) override { 87 void RemoveObserver(DisplayObserver* observer) override {
79 // no display change on Android. 88 // no display change on Android.
80 } 89 }
81 90
82 private: 91 private:
83 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid); 92 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid);
84 }; 93 };
85 94
86 Screen* CreateNativeScreen() { 95 Screen* CreateNativeScreen() {
87 return new ScreenAndroid; 96 return new ScreenAndroid;
88 } 97 }
89 98
90 } // namespace display 99 } // namespace display
OLDNEW
« no previous file with comments | « ui/aura/test/test_screen.cc ('k') | ui/display/ios/screen_ios.mm » ('j') | ui/display/screen.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698