| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 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 #ifndef SKY_SHELL_SKY_VIEW_H_ | |
| 6 #define SKY_SHELL_SKY_VIEW_H_ | |
| 7 | |
| 8 #include "base/android/jni_weak_ref.h" | |
| 9 #include "base/android/scoped_java_ref.h" | |
| 10 #include "base/macros.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "base/single_thread_task_runner.h" | |
| 13 #include "sky/shell/ui_delegate.h" | |
| 14 | |
| 15 struct ANativeWindow; | |
| 16 | |
| 17 namespace sky { | |
| 18 namespace shell { | |
| 19 | |
| 20 class PlatformView { | |
| 21 public: | |
| 22 struct Config { | |
| 23 base::WeakPtr<UIDelegate> ui_delegate; | |
| 24 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner; | |
| 25 }; | |
| 26 | |
| 27 static bool Register(JNIEnv* env); | |
| 28 | |
| 29 explicit PlatformView(const Config& config); | |
| 30 ~PlatformView(); | |
| 31 | |
| 32 void ConnectToViewportObserver( | |
| 33 mojo::InterfaceRequest<ViewportObserver> request); | |
| 34 | |
| 35 // Called from Java | |
| 36 void Detach(JNIEnv* env, jobject obj); | |
| 37 void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface); | |
| 38 void SurfaceDestroyed(JNIEnv* env, jobject obj); | |
| 39 void SurfaceSetSize(JNIEnv* env, | |
| 40 jobject obj, | |
| 41 jint width, | |
| 42 jint height, | |
| 43 jfloat density); | |
| 44 | |
| 45 private: | |
| 46 void ReleaseWindow(); | |
| 47 | |
| 48 Config config_; | |
| 49 ANativeWindow* window_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(PlatformView); | |
| 52 }; | |
| 53 | |
| 54 } // namespace shell | |
| 55 } // namespace sky | |
| 56 | |
| 57 #endif // SKY_SHELL_SKY_VIEW_H_ | |
| OLD | NEW |