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

Unified Diff: ui/android/view_root.h

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: updateViewRoot, ... 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 side-by-side diff with in-line comments
Download patch
Index: ui/android/view_root.h
diff --git a/ui/android/view_root.h b/ui/android/view_root.h
new file mode 100644
index 0000000000000000000000000000000000000000..cfa05169a78986424d02f3393a52ebec7093c299
--- /dev/null
+++ b/ui/android/view_root.h
@@ -0,0 +1,55 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_ANDROID_VIEW_ROOT_H_
+#define UI_ANDROID_VIEW_ROOT_H_
+
+#include <jni.h>
+#include <string>
+#include <vector>
+
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "base/time/time.h"
+#include "ui/android/ui_android_export.h"
+#include "ui/android/view_android.h"
+#include "ui/gfx/geometry/vector2d_f.h"
+
+namespace ui {
+
+// ViewRoot is the root of a ViewAndroid tree.
+class UI_ANDROID_EXPORT ViewRoot : public ViewAndroid {
+ public:
+ ViewRoot(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jlong jwindow_android);
+
+ void Destroy(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+
+ // ViewAndroid overrides.
+ WindowAndroid* GetWindowAndroid() const override;
+ ViewAndroid* GetViewRoot() override;
+
+ static ViewRoot* FromJavaObject(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
+ void OnPhysicalBackingSizeChanged(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jobj,
+ int width,
+ int height);
+
+ private:
+ WindowAndroid* window_;
+
+ DISALLOW_COPY_AND_ASSIGN(ViewRoot);
+};
+
+bool RegisterViewRoot(JNIEnv* env);
+
+} // namespace ui
+
+#endif // UI_ANDROID_VIEW_ROOT_H_

Powered by Google App Engine
This is Rietveld 408576698