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

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

Issue 287003004: Revert 270867 "Mojo: Internalize ServiceConnector<>" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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 | « trunk/src/mojo/dbus/dbus_external_service.h ('k') | trunk/src/mojo/mojo_public.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/mojo/examples/launcher/launcher.cc
===================================================================
--- trunk/src/mojo/examples/launcher/launcher.cc (revision 270872)
+++ trunk/src/mojo/examples/launcher/launcher.cc (working copy)
@@ -188,18 +188,20 @@
DISALLOW_COPY_AND_ASSIGN(LauncherController);
};
-class LauncherImpl : public InterfaceImpl<Launcher>,
+class LauncherImpl : public ServiceConnection<Launcher, LauncherImpl>,
public URLReceiver {
public:
- explicit LauncherImpl(Application* app)
- : app_(app),
- launcher_controller_(this),
+ LauncherImpl()
+ : launcher_controller_(this),
pending_show_(false) {
+ }
+
+ void Initialize() {
screen_.reset(ScreenMojo::Create());
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_NATIVE, screen_.get());
NativeViewportPtr viewport;
- app_->ConnectTo("mojo:mojo_native_viewport_service", &viewport);
+ ConnectTo(shell(), "mojo:mojo_native_viewport_service", &viewport);
window_tree_host_.reset(new WindowTreeHostMojo(
viewport.Pass(), gfx::Rect(50, 50, 450, 60),
@@ -248,7 +250,6 @@
}
}
- Application* app_;
scoped_ptr<ScreenMojo> screen_;
scoped_ptr<LauncherWindowTreeClient> window_tree_client_;
scoped_ptr<aura::client::FocusClient> focus_client_;
@@ -286,7 +287,8 @@
aura::Env::CreateInstance(true);
mojo::Application app(shell_handle);
- app.AddService<mojo::examples::LauncherImpl>(&app);
+ app.AddServiceConnector(
+ new mojo::ServiceConnector<mojo::examples::LauncherImpl>());
loop.Run();
return MOJO_RESULT_OK;
« no previous file with comments | « trunk/src/mojo/dbus/dbus_external_service.h ('k') | trunk/src/mojo/mojo_public.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698