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

Unified Diff: ui/android/view_root.h

Issue 2595263002: Introduce ViewRoot forwarding input/view events to native (Closed)
Patch Set: tests Created 3 years, 12 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..a6b0f89fbc891c6fb10ee02eeaf337195ee58bb6
--- /dev/null
+++ b/ui/android/view_root.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
boliu 2017/01/03 19:16:11 new year!
Jinsuk Kim 2017/01/04 10:45:02 Done.
+// 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();
boliu 2017/01/03 19:16:11 Instead of this, have a "CreateForTesting" method,
Jinsuk Kim 2017/01/04 10:45:02 It's also used in blimp. Replaced it with ViewRoot
+ ViewRoot(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jlong jwindow_android);
+
+ ~ViewRoot() override;
+
+ // ViewAndroid overrides.
+ WindowAndroid* GetWindowAndroid() const override;
+ void SetWindowAndroid(WindowAndroid* window) override;
+
+ static ViewRoot* FromJavaObject(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj);
boliu 2017/01/03 19:16:11 nit: indent is wrong here and below
Jinsuk Kim 2017/01/04 10:45:02 Done.
+ void OnPhysicalBackingSizeChanged(JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& jobj,
+ int width,
+ int height);
+
+ private:
+ // ViewAndroid overrides.
+ ViewAndroid* GetViewRoot() override;
+
+ JavaObjectWeakGlobalRef java_obj_;
boliu 2017/01/03 19:16:11 only looking at ui/ code right now, and it's not c
Jinsuk Kim 2017/01/04 10:45:02 Updated to destroy the native side when all of its
boliu 2017/01/04 17:45:10 That seems wrong for chrome, where we expect the V
Jinsuk Kim 2017/01/05 11:03:12 Done.
+ 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