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

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

Issue 162213002: Change mojo demo apps to use Application. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add shell() to ServiceFactory::Owner Created 6 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
« no previous file with comments | « mojo/examples/compositor_app/compositor_app.cc ('k') | mojo/examples/sample_app/sample_app.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/launcher/launcher.cc
diff --git a/mojo/examples/launcher/launcher.cc b/mojo/examples/launcher/launcher.cc
index 8c3ea63ca0c7aa13cf0b99d0dd81f40fba09bc01..1ba904325d6de264162357ec6f6c983ad8ccef35 100644
--- a/mojo/examples/launcher/launcher.cc
+++ b/mojo/examples/launcher/launcher.cc
@@ -16,6 +16,7 @@
#include "mojo/public/bindings/allocation_scope.h"
#include "mojo/public/bindings/remote_ptr.h"
#include "mojo/public/gles2/gles2_cpp.h"
+#include "mojo/public/shell/application.h"
#include "mojo/public/system/core.h"
#include "mojo/public/system/macros.h"
#include "mojom/launcher.h"
@@ -187,13 +188,13 @@ class LauncherController : public views::TextfieldController {
DISALLOW_COPY_AND_ASSIGN(LauncherController);
};
-class LauncherImpl : public ShellClient,
+class LauncherImpl : public Application,
public Launcher,
public URLReceiver {
public:
- explicit LauncherImpl(ScopedShellHandle shell_handle)
- : launcher_controller_(this),
- shell_(shell_handle.Pass(), this),
+ explicit LauncherImpl(MojoHandle shell_handle)
+ : Application(shell_handle),
+ launcher_controller_(this),
pending_show_(false) {
screen_.reset(DemoScreen::Create());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
@@ -201,8 +202,8 @@ class LauncherImpl : public ShellClient,
InterfacePipe<NativeViewport, AnyInterface> pipe;
AllocationScope scope;
- shell_->Connect("mojo:mojo_native_viewport_service",
- pipe.handle_to_peer.Pass());
+ shell()->Connect("mojo:mojo_native_viewport_service",
+ pipe.handle_to_peer.Pass());
root_window_host_.reset(new WindowTreeHostMojo(
pipe.handle_to_self.Pass(), gfx::Rect(50, 50, 450, 60),
@@ -210,7 +211,7 @@ class LauncherImpl : public ShellClient,
}
private:
- // Overridden from ShellClient:
+ // Overridden from Application:
virtual void AcceptConnection(const mojo::String& url,
ScopedMessagePipeHandle handle) MOJO_OVERRIDE {
launcher_client_.reset(
@@ -272,7 +273,6 @@ class LauncherImpl : public ShellClient,
LauncherController launcher_controller_;
- RemotePtr<Shell> shell_;
RemotePtr<LauncherClient> launcher_client_;
scoped_ptr<WindowTreeHostMojo> root_window_host_;
scoped_ptr<aura::RootWindow> root_window_;
@@ -302,8 +302,7 @@ extern "C" LAUNCHER_EXPORT MojoResult CDECL MojoMain(
// MessageLoop is not of TYPE_UI. I think we need a way to build
// Aura that doesn't define platform-specific stuff.
aura::Env::CreateInstance();
- mojo::examples::LauncherImpl launcher(
- mojo::MakeScopedHandle(mojo::ShellHandle(shell_handle)).Pass());
+ mojo::examples::LauncherImpl launcher(shell_handle);
loop.Run();
return MOJO_RESULT_OK;
« no previous file with comments | « mojo/examples/compositor_app/compositor_app.cc ('k') | mojo/examples/sample_app/sample_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698