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

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

Issue 393093003: Mojo: Move sample_app out from namespace mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 5 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/sample_app/gles2_client_impl.cc ('k') | mojo/examples/sample_app/spinning_cube.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/sample_app/sample_app.cc
diff --git a/mojo/examples/sample_app/sample_app.cc b/mojo/examples/sample_app/sample_app.cc
index cfc9ef7b45ee3aec3dc743694fcd77671ec03229..1b8e874a79faf2790d3a524ea4d12400230206cc 100644
--- a/mojo/examples/sample_app/sample_app.cc
+++ b/mojo/examples/sample_app/sample_app.cc
@@ -16,10 +16,10 @@
#include "mojo/public/interfaces/service_provider/service_provider.mojom.h"
#include "mojo/services/public/interfaces/native_viewport/native_viewport.mojom.h"
-namespace mojo {
namespace examples {
-class SampleApp : public ApplicationDelegate, public NativeViewportClient {
+class SampleApp : public mojo::ApplicationDelegate,
+ public mojo::NativeViewportClient {
public:
SampleApp() {}
@@ -28,11 +28,11 @@ class SampleApp : public ApplicationDelegate, public NativeViewportClient {
MOJO_ALLOW_UNUSED GLES2ClientImpl* leaked = gles2_client_.release();
}
- virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
+ virtual void Initialize(mojo::ApplicationImpl* app) MOJO_OVERRIDE {
app->ConnectToService("mojo:mojo_native_viewport_service", &viewport_);
viewport_.set_client(this);
- RectPtr rect(Rect::New());
+ mojo::RectPtr rect(mojo::Rect::New());
rect->x = 10;
rect->y = 10;
rect->width = 800;
@@ -40,7 +40,7 @@ class SampleApp : public ApplicationDelegate, public NativeViewportClient {
viewport_->Create(rect.Pass());
viewport_->Show();
- CommandBufferPtr command_buffer;
+ mojo::CommandBufferPtr command_buffer;
viewport_->CreateGLES2Context(Get(&command_buffer));
gles2_client_.reset(new GLES2ClientImpl(command_buffer.Pass()));
}
@@ -50,20 +50,20 @@ class SampleApp : public ApplicationDelegate, public NativeViewportClient {
virtual void OnDestroyed(
const mojo::Callback<void()>& callback) MOJO_OVERRIDE {
- RunLoop::current()->Quit();
+ mojo::RunLoop::current()->Quit();
callback.Run();
}
- virtual void OnBoundsChanged(RectPtr bounds) MOJO_OVERRIDE {
+ virtual void OnBoundsChanged(mojo::RectPtr bounds) MOJO_OVERRIDE {
assert(bounds);
- SizePtr size(Size::New());
+ mojo::SizePtr size(mojo::Size::New());
size->width = bounds->width;
size->height = bounds->height;
gles2_client_->SetSize(*size);
}
- virtual void OnEvent(EventPtr event,
- const Callback<void()>& callback) MOJO_OVERRIDE {
+ virtual void OnEvent(mojo::EventPtr event,
+ const mojo::Callback<void()>& callback) MOJO_OVERRIDE {
assert(event);
if (event->location)
gles2_client_->HandleInputEvent(*event);
@@ -73,13 +73,15 @@ class SampleApp : public ApplicationDelegate, public NativeViewportClient {
private:
mojo::GLES2Initializer gles2;
scoped_ptr<GLES2ClientImpl> gles2_client_;
- NativeViewportPtr viewport_;
+ mojo::NativeViewportPtr viewport_;
DISALLOW_COPY_AND_ASSIGN(SampleApp);
};
} // namespace examples
+namespace mojo {
+
// static
ApplicationDelegate* ApplicationDelegate::Create() {
return new examples::SampleApp();
« no previous file with comments | « mojo/examples/sample_app/gles2_client_impl.cc ('k') | mojo/examples/sample_app/spinning_cube.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698