Index: sky/shell/sky_view.h |
diff --git a/sky/shell/sky_view.h b/sky/shell/sky_view.h |
index 300d926f591f52bc6dba29cb934611e3cc6a45b9..b326ea37be429b969e15bd1d5c6bb25cd2187598 100644 |
--- a/sky/shell/sky_view.h |
+++ b/sky/shell/sky_view.h |
@@ -8,7 +8,10 @@ |
#include "base/android/jni_weak_ref.h" |
#include "base/android/scoped_java_ref.h" |
#include "base/macros.h" |
-#include "ui/gfx/native_widget_types.h" |
+#include "base/memory/weak_ptr.h" |
+#include "base/single_thread_task_runner.h" |
+#include "sky/shell/gpu_delegate.h" |
+#include "sky/shell/ui_delegate.h" |
struct ANativeWindow; |
@@ -17,22 +20,18 @@ namespace shell { |
class SkyView { |
public: |
- static bool Register(JNIEnv* env); |
- |
- class Delegate { |
- public: |
- virtual void OnAcceleratedWidgetAvailable( |
- gfx::AcceleratedWidget widget) = 0; |
- virtual void OnDestroyed() = 0; |
+ struct Config { |
+ base::WeakPtr<GPUDelegate> gpu_delegate; |
+ scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner; |
eseidel
2015/02/05 05:57:28
Is it OK to hold the runner after the delegate goe
abarth-chromium
2015/02/05 06:16:23
Yes, base::SingleThreadTaskRunner is designed to b
|
- protected: |
- virtual ~Delegate(); |
+ base::WeakPtr<UIDelegate> ui_delegate; |
+ scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner; |
}; |
- explicit SkyView(Delegate* delegate); |
- ~SkyView(); |
+ static bool Register(JNIEnv* env); |
- void Init(); |
+ explicit SkyView(const Config& config); |
+ ~SkyView(); |
// Called from Java |
void Destroy(JNIEnv* env, jobject obj); |
@@ -47,7 +46,7 @@ class SkyView { |
private: |
void ReleaseWindow(); |
- Delegate* delegate_; |
+ Config config_; |
ANativeWindow* window_; |
DISALLOW_COPY_AND_ASSIGN(SkyView); |