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

Unified Diff: mojo/examples/aura_demo/view_manager_init.cc

Issue 591633002: Replace most uses of ViewManagerInitService with client lib ViewManager::Embed() to offer the same … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 3 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/aura_demo/aura_demo.cc ('k') | mojo/examples/demo_launcher/demo_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/aura_demo/view_manager_init.cc
diff --git a/mojo/examples/aura_demo/view_manager_init.cc b/mojo/examples/aura_demo/view_manager_init.cc
index 7113109321edbe346a761efb9ca6da642a40ae58..5a4310caae8439bc6ceffdb04ca0cb56e03ed61e 100644
--- a/mojo/examples/aura_demo/view_manager_init.cc
+++ b/mojo/examples/aura_demo/view_manager_init.cc
@@ -9,41 +9,32 @@
#include "mojo/public/cpp/application/application_delegate.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
-#include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
+#include "mojo/services/public/cpp/view_manager/view_manager.h"
+#include "mojo/services/public/cpp/view_manager/view_manager_context.h"
-namespace mojo {
namespace examples {
// ViewManagerInit is responsible for establishing the initial connection to
// the view manager. When established it loads |mojo_aura_demo|.
-class ViewManagerInit : public ApplicationDelegate {
+class ViewManagerInit : public mojo::ApplicationDelegate {
public:
ViewManagerInit() {}
virtual ~ViewManagerInit() {}
- virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
- app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_);
- ServiceProviderPtr sp;
- view_manager_init_->Embed("mojo:mojo_aura_demo", sp.Pass(),
- base::Bind(&ViewManagerInit::DidConnect,
- base::Unretained(this)));
+ virtual void Initialize(mojo::ApplicationImpl* app) MOJO_OVERRIDE {
+ context_.reset(new mojo::ViewManagerContext(app));
+ context_->Embed("mojo:mojo_aura_demo");
}
private:
- void DidConnect(bool result) {
- DCHECK(result);
- VLOG(1) << "ViewManagerInit::DidConnection result=" << result;
- }
-
- ViewManagerInitServicePtr view_manager_init_;
+ scoped_ptr<mojo::ViewManagerContext> context_;
DISALLOW_COPY_AND_ASSIGN(ViewManagerInit);
};
} // namespace examples
-} // namespace mojo
MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunnerChromium runner(new mojo::examples::ViewManagerInit);
+ mojo::ApplicationRunnerChromium runner(new examples::ViewManagerInit);
return runner.Run(shell_handle);
}
« no previous file with comments | « mojo/examples/aura_demo/aura_demo.cc ('k') | mojo/examples/demo_launcher/demo_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698