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

Unified Diff: mojo/examples/compositor_app/compositor_app.cc

Issue 294833002: Mojo: more idiomatic C++ bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/examples/compositor_app/compositor_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/compositor_app/compositor_app.cc
diff --git a/mojo/examples/compositor_app/compositor_app.cc b/mojo/examples/compositor_app/compositor_app.cc
index 7209537f9a7d4620e6ab31681ee44b9dd6812b51..0b4baaa26abf8af37aa56ffe5848c84568de0bec 100644
--- a/mojo/examples/compositor_app/compositor_app.cc
+++ b/mojo/examples/compositor_app/compositor_app.cc
@@ -8,7 +8,6 @@
#include "base/macros.h"
#include "mojo/examples/compositor_app/compositor_host.h"
#include "mojo/public/cpp/application/application.h"
-#include "mojo/public/cpp/bindings/allocation_scope.h"
#include "mojo/public/cpp/gles2/gles2.h"
#include "mojo/public/cpp/system/core.h"
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
@@ -25,12 +24,10 @@ class SampleApp : public Application, public NativeViewportClient {
virtual ~SampleApp() {}
virtual void Initialize() OVERRIDE {
- AllocationScope scope;
-
ConnectTo("mojo:mojo_native_viewport_service", &viewport_);
viewport_.set_client(this);
- viewport_->Create(gfx::Rect(10, 10, 800, 600));
+ viewport_->Create(Rect::From(gfx::Rect(10, 10, 800, 600)));
viewport_->Show();
MessagePipe gles2_pipe;
@@ -45,15 +42,11 @@ class SampleApp : public Application, public NativeViewportClient {
base::MessageLoop::current()->Quit();
}
- virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE {
- AllocationScope scope;
- Size::Builder size;
- size.set_width(bounds.width());
- size.set_height(bounds.height());
- host_->SetSize(size.Finish());
+ virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE {
+ host_->SetSize(gfx::Size(bounds->width, bounds->height));
}
- virtual void OnEvent(const Event& event,
+ virtual void OnEvent(EventPtr event,
const mojo::Callback<void()>& callback) OVERRIDE {
callback.Run();
}
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/examples/compositor_app/compositor_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698