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

Unified Diff: mojo/examples/pepper_container_app/pepper_container_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/launcher/launcher.cc ('k') | mojo/examples/pepper_container_app/type_converters.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/pepper_container_app/pepper_container_app.cc
diff --git a/mojo/examples/pepper_container_app/pepper_container_app.cc b/mojo/examples/pepper_container_app/pepper_container_app.cc
index 33c03d5d538c5f96a1100044315b3afda55b7209..8d8b4e925a06b60263790e9274499ca214d11a75 100644
--- a/mojo/examples/pepper_container_app/pepper_container_app.cc
+++ b/mojo/examples/pepper_container_app/pepper_container_app.cc
@@ -12,7 +12,6 @@
#include "mojo/examples/pepper_container_app/plugin_module.h"
#include "mojo/examples/pepper_container_app/type_converters.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"
@@ -34,18 +33,16 @@ class PepperContainerApp: public Application,
virtual ~PepperContainerApp() {}
- virtual void Initialize() MOJO_OVERRIDE {
- mojo::AllocationScope scope;
-
+ virtual void Initialize() MOJO_OVERRIDE {
ConnectTo("mojo:mojo_native_viewport_service", &viewport_);
viewport_.set_client(this);
- Rect::Builder rect;
- rect.set_x(10);
- rect.set_y(10);
- rect.set_width(800);
- rect.set_height(600);
- viewport_->Create(rect.Finish());
+ RectPtr rect(Rect::New());
+ rect->x = 10;
+ rect->y = 10;
+ rect->width = 800;
+ rect->height = 600;
+ viewport_->Create(rect.Pass());
viewport_->Show();
}
@@ -69,16 +66,16 @@ class PepperContainerApp: public Application,
base::MessageLoop::current()->Quit();
}
- virtual void OnBoundsChanged(const Rect& bounds) OVERRIDE {
+ virtual void OnBoundsChanged(RectPtr bounds) OVERRIDE {
ppapi::ProxyAutoLock lock;
if (plugin_instance_)
- plugin_instance_->DidChangeView(bounds);
+ plugin_instance_->DidChangeView(bounds.To<PP_Rect>());
}
- virtual void OnEvent(const Event& event,
+ virtual void OnEvent(EventPtr event,
const mojo::Callback<void()>& callback) OVERRIDE {
- if (!event.location().is_null()) {
+ if (!event->location.is_null()) {
ppapi::ProxyAutoLock lock;
// TODO(yzshen): Handle events.
« no previous file with comments | « mojo/examples/launcher/launcher.cc ('k') | mojo/examples/pepper_container_app/type_converters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698