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 "ui/gfx/native_widget_types.h" |
| 12 |
| 13 struct ANativeWindow; |
| 14 |
| 15 namespace sky { |
| 16 namespace shell { |
| 17 |
| 18 class SkyView { |
| 19 public: |
| 20 static bool Register(JNIEnv* env); |
| 21 |
| 22 class Delegate { |
| 23 public: |
| 24 virtual void OnAcceleratedWidgetAvailable( |
| 25 gfx::AcceleratedWidget widget) = 0; |
| 26 virtual void OnDestroyed() = 0; |
| 27 |
| 28 protected: |
| 29 virtual ~Delegate(); |
| 30 }; |
| 31 |
| 32 explicit SkyView(Delegate* delegate); |
| 33 ~SkyView(); |
| 34 |
| 35 void Init(); |
| 36 |
| 37 // Called from Java |
| 38 void Destroy(JNIEnv* env, jobject obj); |
| 39 void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface); |
| 40 void SurfaceDestroyed(JNIEnv* env, jobject obj); |
| 41 void SurfaceSetSize(JNIEnv* env, |
| 42 jobject obj, |
| 43 jint width, |
| 44 jint height, |
| 45 jfloat density); |
| 46 |
| 47 private: |
| 48 void ReleaseWindow(); |
| 49 |
| 50 Delegate* delegate_; |
| 51 ANativeWindow* window_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(SkyView); |
| 54 }; |
| 55 |
| 56 } // namespace shell |
| 57 } // namespace sky |
| 58 |
| 59 #endif // SKY_SHELL_SKY_VIEW_H_ |
OLD | NEW |