OLD | NEW |
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 Loading... |
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 |
OLD | NEW |