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

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

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: view_root.java_obj_... 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
« no previous file with comments | « ui/android/view_root.h ('k') | ui/android/window_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ui/android/view_root.h"
6
7 #include <jni.h>
8 #include <string>
9 #include <vector>
10
11 #include "base/android/jni_weak_ref.h"
12 #include "base/android/scoped_java_ref.h"
13 #include "base/macros.h"
14 #include "base/observer_list.h"
15 #include "base/time/time.h"
16 #include "jni/ViewRoot_jni.h"
17 #include "ui/android/ui_android_export.h"
18 #include "ui/android/view_android.h"
19 #include "ui/gfx/geometry/vector2d_f.h"
20
21 namespace ui {
22
23 using base::android::JavaParamRef;
24 using base::android::JavaRef;
25 using base::android::ScopedJavaLocalRef;
26
27 ViewRoot::ViewRoot(jlong window_android_ptr) {
28 WindowAndroid* window_android =
29 reinterpret_cast<WindowAndroid*>(window_android_ptr);
30 window_ = window_android;
31 }
32
33 void ViewRoot::Destroy(JNIEnv* env,
34 const base::android::JavaParamRef<jobject>& obj) {
35 delete this;
36 }
37
38 ViewAndroid* ViewRoot::GetViewRoot() {
39 return this;
40 }
41
42 WindowAndroid* ViewRoot::GetWindowAndroid() const {
43 return window_;
44 }
45
46 // static
47 void ViewRoot::OnPhysicalBackingSizeChanged(JNIEnv* env,
48 const JavaParamRef<jobject>& jobj,
49 int width,
50 int height) {
51 OnPhysicalBackingSizeChangedInternal(width, height);
52 }
53
54 // static
55 jlong Init(JNIEnv* env,
56 const JavaParamRef<jobject>& obj,
57 jlong window_android_ptr) {
58 return reinterpret_cast<intptr_t>(new ViewRoot(window_android_ptr));
59 }
60
61 bool RegisterViewRoot(JNIEnv* env) {
62 return RegisterNativesImpl(env);
63 }
64
65 } // namespace ui
OLDNEW
« no previous file with comments | « ui/android/view_root.h ('k') | ui/android/window_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698