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

Unified Diff: sky/shell/ui/engine.h

Issue 932283002: Port touch-demo.sky to Dart and make it work in SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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/ui/engine.h
diff --git a/sky/shell/ui/engine.h b/sky/shell/ui/engine.h
index ec21ab4e88347c6a3633069b863b8c2a0c27bd91..1aafbb39f4a5004bfa8d57a856405351f8c105d1 100644
--- a/sky/shell/ui/engine.h
+++ b/sky/shell/ui/engine.h
@@ -9,6 +9,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
+#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/system/core.h"
#include "skia/ext/refptr.h"
#include "sky/engine/public/web/WebFrameClient.h"
@@ -24,6 +25,7 @@ class Animator;
class PlatformImpl;
class Engine : public UIDelegate,
+ public ViewportObserver,
public blink::WebFrameClient,
public blink::WebViewClient {
public:
@@ -44,8 +46,13 @@ class Engine : public UIDelegate,
private:
// UIDelegate methods:
- void OnViewportMetricsChanged(const gfx::Size& physical_size,
+ void ConnectToViewportObserver(
+ mojo::InterfaceRequest<ViewportObserver> request) override;
+
+ // ViewportObserver:
+ void OnViewportMetricsChanged(int width, int height,
float device_pixel_ratio) override;
+ void OnInputEvent(InputEventPtr event) override;
// WebViewClient methods:
void initializeLayerTreeView() override;
@@ -54,7 +61,9 @@ class Engine : public UIDelegate,
scoped_ptr<PlatformImpl> platform_impl_;
scoped_ptr<Animator> animator_;
blink::WebView* web_view_;
+ float device_pixel_ratio_;
gfx::Size physical_size_;
+ mojo::Binding<ViewportObserver> viewport_observer_binding_;
base::WeakPtrFactory<Engine> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698