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

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

Issue 2747143005: Revert of Add display::GetDisplayNearestView (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « ui/android/display_android_manager.h ('k') | ui/android/dummy_screen_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/android/display_android_manager.h" 5 #include "ui/android/display_android_manager.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 #include <map> 8 #include <map>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 24 matching lines...) Expand all
35 return RegisterNativesImpl(env); 35 return RegisterNativesImpl(env);
36 } 36 }
37 37
38 DisplayAndroidManager::DisplayAndroidManager() {} 38 DisplayAndroidManager::DisplayAndroidManager() {}
39 39
40 DisplayAndroidManager::~DisplayAndroidManager() {} 40 DisplayAndroidManager::~DisplayAndroidManager() {}
41 41
42 // Screen interface. 42 // Screen interface.
43 43
44 Display DisplayAndroidManager::GetDisplayNearestWindow( 44 Display DisplayAndroidManager::GetDisplayNearestWindow(
45 gfx::NativeWindow window) const { 45 gfx::NativeView view) const {
46 ui::WindowAndroid* window = view ? view->GetWindowAndroid() : nullptr;
46 if (window) { 47 if (window) {
47 DisplayList::Displays::const_iterator it = 48 DisplayList::Displays::const_iterator it =
48 display_list().FindDisplayById(window->display_id()); 49 display_list().FindDisplayById(window->display_id());
49 if (it != display_list().displays().end()) { 50 if (it != display_list().displays().end()) {
50 return *it; 51 return *it;
51 } 52 }
52 } 53 }
53 return GetPrimaryDisplay(); 54 return GetPrimaryDisplay();
54 } 55 }
55 56
56 Display DisplayAndroidManager::GetDisplayNearestView(
57 gfx::NativeView view) const {
58 return GetDisplayNearestWindow(view ? view->GetWindowAndroid() : nullptr);
59 }
60
61 // There is no notion of relative display positions on Android. 57 // There is no notion of relative display positions on Android.
62 Display DisplayAndroidManager::GetDisplayNearestPoint( 58 Display DisplayAndroidManager::GetDisplayNearestPoint(
63 const gfx::Point& point) const { 59 const gfx::Point& point) const {
64 NOTIMPLEMENTED(); 60 NOTIMPLEMENTED();
65 return GetPrimaryDisplay(); 61 return GetPrimaryDisplay();
66 } 62 }
67 63
68 // There is no notion of relative display positions on Android. 64 // There is no notion of relative display positions on Android.
69 Display DisplayAndroidManager::GetDisplayMatching( 65 Display DisplayAndroidManager::GetDisplayMatching(
70 const gfx::Rect& match_rect) const { 66 const gfx::Rect& match_rect) const {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 112 }
117 113
118 void DisplayAndroidManager::SetPrimaryDisplayId( 114 void DisplayAndroidManager::SetPrimaryDisplayId(
119 JNIEnv* env, 115 JNIEnv* env,
120 const base::android::JavaParamRef<jobject>& jobject, 116 const base::android::JavaParamRef<jobject>& jobject,
121 jint sdkDisplayId) { 117 jint sdkDisplayId) {
122 primary_display_id_ = sdkDisplayId; 118 primary_display_id_ = sdkDisplayId;
123 } 119 }
124 120
125 } // namespace ui 121 } // namespace ui
OLDNEW
« no previous file with comments | « ui/android/display_android_manager.h ('k') | ui/android/dummy_screen_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698