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

Unified Diff: sky/shell/sky_view.h

Issue 880443003: Plumb resize notifications around sky/shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: git cl format Created 5 years, 10 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: 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);

Powered by Google App Engine
This is Rietveld 408576698