| Index: ui/android/view_root.cc
|
| diff --git a/ui/android/view_root.cc b/ui/android/view_root.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5099fcc9499b7996056cef362113d00a16e85dbd
|
| --- /dev/null
|
| +++ b/ui/android/view_root.cc
|
| @@ -0,0 +1,65 @@
|
| +// 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.
|
| +
|
| +#include "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/observer_list.h"
|
| +#include "base/time/time.h"
|
| +#include "jni/ViewRoot_jni.h"
|
| +#include "ui/android/ui_android_export.h"
|
| +#include "ui/android/view_android.h"
|
| +#include "ui/gfx/geometry/vector2d_f.h"
|
| +
|
| +namespace ui {
|
| +
|
| +using base::android::JavaParamRef;
|
| +using base::android::JavaRef;
|
| +using base::android::ScopedJavaLocalRef;
|
| +
|
| +ViewRoot::ViewRoot(jlong window_android_ptr) {
|
| + WindowAndroid* window_android =
|
| + reinterpret_cast<WindowAndroid*>(window_android_ptr);
|
| + window_ = window_android;
|
| +}
|
| +
|
| +void ViewRoot::Destroy(JNIEnv* env,
|
| + const base::android::JavaParamRef<jobject>& obj) {
|
| + delete this;
|
| +}
|
| +
|
| +ViewAndroid* ViewRoot::GetViewRoot() {
|
| + return this;
|
| +}
|
| +
|
| +WindowAndroid* ViewRoot::GetWindowAndroid() const {
|
| + return window_;
|
| +}
|
| +
|
| +// static
|
| +void ViewRoot::OnPhysicalBackingSizeChanged(JNIEnv* env,
|
| + const JavaParamRef<jobject>& jobj,
|
| + int width,
|
| + int height) {
|
| + OnPhysicalBackingSizeChangedInternal(width, height);
|
| +}
|
| +
|
| +// static
|
| +jlong Init(JNIEnv* env,
|
| + const JavaParamRef<jobject>& obj,
|
| + jlong window_android_ptr) {
|
| + return reinterpret_cast<intptr_t>(new ViewRoot(window_android_ptr));
|
| +}
|
| +
|
| +bool RegisterViewRoot(JNIEnv* env) {
|
| + return RegisterNativesImpl(env);
|
| +}
|
| +
|
| +} // namespace ui
|
|
|