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

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

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: addressed comments Created 3 years, 11 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 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 21 matching lines...) Expand all
32 } 32 }
33 33
34 bool RegisterScreenAndroid(JNIEnv* env) { 34 bool RegisterScreenAndroid(JNIEnv* env) {
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 Display DisplayAndroidManager::GetDisplayNearestWindowAndroid(
43 43 gfx::NativeWindow window) const {
44 Display DisplayAndroidManager::GetDisplayNearestWindow(
45 gfx::NativeView view) const {
46 ui::WindowAndroid* window = view ? view->GetWindowAndroid() : nullptr;
47 if (window) { 44 if (window) {
48 DisplayList::Displays::const_iterator it = 45 DisplayList::Displays::const_iterator it =
49 display_list().FindDisplayById(window->display_id()); 46 display_list().FindDisplayById(window->display_id());
50 if (it != display_list().displays().end()) { 47 if (it != display_list().displays().end()) {
51 return *it; 48 return *it;
52 } 49 }
53 } 50 }
54 return GetPrimaryDisplay(); 51 return GetPrimaryDisplay();
55 } 52 }
56 53
54 // Screen interface.
55
56 Display DisplayAndroidManager::GetDisplayNearestWindow(
57 gfx::NativeView view) const {
58 ui::WindowAndroid* window = view ? view->GetWindowAndroid() : nullptr;
59 return GetDisplayNearestWindowAndroid(window);
60 }
61
57 // There is no notion of relative display positions on Android. 62 // There is no notion of relative display positions on Android.
58 Display DisplayAndroidManager::GetDisplayNearestPoint( 63 Display DisplayAndroidManager::GetDisplayNearestPoint(
59 const gfx::Point& point) const { 64 const gfx::Point& point) const {
60 NOTIMPLEMENTED(); 65 NOTIMPLEMENTED();
61 return GetPrimaryDisplay(); 66 return GetPrimaryDisplay();
62 } 67 }
63 68
64 // There is no notion of relative display positions on Android. 69 // There is no notion of relative display positions on Android.
65 Display DisplayAndroidManager::GetDisplayMatching( 70 Display DisplayAndroidManager::GetDisplayMatching(
66 const gfx::Rect& match_rect) const { 71 const gfx::Rect& match_rect) const {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 116 }
112 117
113 void DisplayAndroidManager::SetPrimaryDisplayId( 118 void DisplayAndroidManager::SetPrimaryDisplayId(
114 JNIEnv* env, 119 JNIEnv* env,
115 const base::android::JavaParamRef<jobject>& jobject, 120 const base::android::JavaParamRef<jobject>& jobject,
116 jint sdkDisplayId) { 121 jint sdkDisplayId) {
117 primary_display_id_ = sdkDisplayId; 122 primary_display_id_ = sdkDisplayId;
118 } 123 }
119 124
120 } // namespace ui 125 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698