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

Side by Side Diff: mojo/examples/aura_demo/view_manager_init.cc

Issue 405163002: Add EmbedRoot to ViewManagerService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | mojo/examples/demo_launcher/demo_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "mojo/public/cpp/application/application_delegate.h" 7 #include "mojo/public/cpp/application/application_delegate.h"
8 #include "mojo/public/cpp/application/application_impl.h" 8 #include "mojo/public/cpp/application/application_impl.h"
9 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" 9 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 namespace examples { 12 namespace examples {
13 13
14 // ViewManagerInit is responsible for establishing the initial connection to 14 // ViewManagerInit is responsible for establishing the initial connection to
15 // the view manager. When established it loads |mojo_aura_demo|. 15 // the view manager. When established it loads |mojo_aura_demo|.
16 class ViewManagerInit : public ApplicationDelegate { 16 class ViewManagerInit : public ApplicationDelegate {
17 public: 17 public:
18 ViewManagerInit() {} 18 ViewManagerInit() {}
19 virtual ~ViewManagerInit() {} 19 virtual ~ViewManagerInit() {}
20 20
21 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { 21 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
22 app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_); 22 app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_);
23 view_manager_init_->EmbedRoot("mojo:mojo_aura_demo", 23 view_manager_init_->Embed("mojo:mojo_aura_demo",
24 base::Bind(&ViewManagerInit::DidConnect, 24 base::Bind(&ViewManagerInit::DidConnect,
25 base::Unretained(this))); 25 base::Unretained(this)));
26 } 26 }
27 27
28 private: 28 private:
29 void DidConnect(bool result) { 29 void DidConnect(bool result) {
30 DCHECK(result); 30 DCHECK(result);
31 VLOG(1) << "ViewManagerInit::DidConnection result=" << result; 31 VLOG(1) << "ViewManagerInit::DidConnection result=" << result;
32 } 32 }
33 33
34 view_manager::ViewManagerInitServicePtr view_manager_init_; 34 view_manager::ViewManagerInitServicePtr view_manager_init_;
35 35
36 DISALLOW_COPY_AND_ASSIGN(ViewManagerInit); 36 DISALLOW_COPY_AND_ASSIGN(ViewManagerInit);
37 }; 37 };
38 38
39 } // namespace examples 39 } // namespace examples
40 40
41 // static 41 // static
42 ApplicationDelegate* ApplicationDelegate::Create() { 42 ApplicationDelegate* ApplicationDelegate::Create() {
43 return new examples::ViewManagerInit(); 43 return new examples::ViewManagerInit();
44 } 44 }
45 45
46 } // namespace mojo 46 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | mojo/examples/demo_launcher/demo_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698