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

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

Issue 275363002: Internalize ServiceConnector<> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 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/launcher/launcher.cc
diff --git a/mojo/examples/launcher/launcher.cc b/mojo/examples/launcher/launcher.cc
index cbee9d712cfaf1fb4bf9c3997221aaf745b3b074..0a9738730ef27e3b52d1bd2c6af6af47bd7e114d 100644
--- a/mojo/examples/launcher/launcher.cc
+++ b/mojo/examples/launcher/launcher.cc
@@ -188,11 +188,12 @@ class LauncherController : public views::TextfieldController {
DISALLOW_COPY_AND_ASSIGN(LauncherController);
};
-class LauncherImpl : public ServiceConnection<Launcher, LauncherImpl>,
+class LauncherImpl : public InterfaceImpl<Launcher>,
darin (slow to review) 2014/05/12 22:04:52 looks nice! :)
public URLReceiver {
public:
- LauncherImpl()
- : launcher_controller_(this),
+ LauncherImpl(Application* app)
darin (slow to review) 2014/05/12 22:04:52 nit: explicit ctor
DaveMoore 2014/05/14 16:50:31 Done.
+ : app_(app),
+ launcher_controller_(this),
launcher_client_(NULL),
pending_show_(false) {
}
@@ -202,7 +203,7 @@ class LauncherImpl : public ServiceConnection<Launcher, LauncherImpl>,
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
NativeViewportPtr viewport;
- ConnectTo(shell(), "mojo:mojo_native_viewport_service", &viewport);
+ ConnectTo(app_->shell(), "mojo:mojo_native_viewport_service", &viewport);
darin (slow to review) 2014/05/12 22:04:52 You could write app_->ConnectTo("mojo:...", &viewp
DaveMoore 2014/05/14 16:50:31 Done.
window_tree_host_.reset(new WindowTreeHostMojo(
viewport.Pass(), gfx::Rect(50, 50, 450, 60),
@@ -254,6 +255,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_;
@@ -292,8 +294,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);
darin (slow to review) 2014/05/12 22:04:52 oh, that's an interesting way of using the Context
loop.Run();
return MOJO_RESULT_OK;

Powered by Google App Engine
This is Rietveld 408576698