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

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: more 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
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 33398047a915a258b79847aa779e9223d7eed873..58df4d0da231a9d12150e0b69d7a454d9af84cb0 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 "base/message_loop/message_loop.h"
#include "mojo/examples/compositor_app/compositor_host.h"
-#include "mojo/public/cpp/bindings/allocation_scope.h"
#include "mojo/public/cpp/gles2/gles2.h"
#include "mojo/public/cpp/shell/application.h"
#include "mojo/public/cpp/system/core.h"
@@ -33,12 +32,10 @@ namespace examples {
class SampleApp : public Application, public NativeViewportClient {
public:
explicit SampleApp(MojoHandle shell_handle) : Application(shell_handle) {
- AllocationScope scope;
-
ConnectTo("mojo:mojo_native_viewport_service", &viewport_);
viewport_->SetClient(this);
- viewport_->Create(gfx::Rect(10, 10, 800, 600));
+ viewport_->Create(Rect::From(gfx::Rect(10, 10, 800, 600)));
viewport_->Show();
MessagePipe gles2_pipe;
@@ -53,11 +50,11 @@ class SampleApp : public Application, public NativeViewportClient {
base::MessageLoop::current()->Quit();
}
- virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE {
- host_->SetSize(bounds.size());
+ virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE {
+ host_->SetSize(bounds->size.To<gfx::Size>());
}
- virtual void OnEvent(const Event& event,
+ virtual void OnEvent(EventPtr event,
const mojo::Callback<void()>& callback) OVERRIDE {
callback.Run();
}

Powered by Google App Engine
This is Rietveld 408576698