| Index: mojo/examples/launcher/launcher.cc
|
| diff --git a/mojo/examples/launcher/launcher.cc b/mojo/examples/launcher/launcher.cc
|
| index e39b3b3869ec19e4bf44e0a55419e257f53468dc..302f30cf3d9277f1e0b8a74a90d34b9a4fb17c94 100644
|
| --- a/mojo/examples/launcher/launcher.cc
|
| +++ b/mojo/examples/launcher/launcher.cc
|
| @@ -188,26 +188,27 @@ class LauncherController : public views::TextfieldController {
|
| DISALLOW_COPY_AND_ASSIGN(LauncherController);
|
| };
|
|
|
| -class LauncherImpl : public ServiceConnection<Launcher, LauncherImpl>,
|
| +class LauncherImpl : public InterfaceImpl<Launcher>,
|
| public URLReceiver {
|
| public:
|
| - LauncherImpl()
|
| - : launcher_controller_(this),
|
| + explicit LauncherImpl(Application* app)
|
| + : app_(app),
|
| + launcher_controller_(this),
|
| pending_show_(false) {
|
| - }
|
| -
|
| - void Initialize() {
|
| screen_.reset(ScreenMojo::Create());
|
| gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
|
|
|
| NativeViewportPtr viewport;
|
| - ConnectTo(shell(), "mojo:mojo_native_viewport_service", &viewport);
|
| + app_->ConnectTo("mojo:mojo_native_viewport_service", &viewport);
|
|
|
| window_tree_host_.reset(new WindowTreeHostMojo(
|
| viewport.Pass(), gfx::Rect(50, 50, 450, 60),
|
| base::Bind(&LauncherImpl::HostContextCreated, base::Unretained(this))));
|
| }
|
|
|
| + // Overridden from InterfaceImpl:
|
| + virtual void OnConnectionError() OVERRIDE {}
|
| +
|
| private:
|
| // Overridden from Launcher:
|
| virtual void Show() OVERRIDE {
|
| @@ -250,6 +251,7 @@ class LauncherImpl : public ServiceConnection<Launcher, LauncherImpl>,
|
| }
|
| }
|
|
|
| + Application* app_;
|
| scoped_ptr<ScreenMojo> screen_;
|
| scoped_ptr<LauncherWindowTreeClient> window_tree_client_;
|
| scoped_ptr<aura::client::FocusClient> focus_client_;
|
| @@ -287,8 +289,7 @@ extern "C" LAUNCHER_EXPORT MojoResult CDECL MojoMain(
|
| aura::Env::CreateInstance(true);
|
|
|
| mojo::Application app(shell_handle);
|
| - app.AddServiceConnector(
|
| - new mojo::ServiceConnector<mojo::examples::LauncherImpl>());
|
| + app.AddService<mojo::examples::LauncherImpl>(&app);
|
|
|
| loop.Run();
|
| return MOJO_RESULT_OK;
|
|
|