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

Side by Side Diff: mojo/examples/demo_launcher/demo_launcher.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
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 "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "mojo/public/cpp/application/application_connection.h" 8 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 9 #include "mojo/public/cpp/application/application_delegate.h"
10 #include "mojo/public/cpp/application/application_impl.h" 10 #include "mojo/public/cpp/application/application_impl.h"
11 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h" 11 #include "mojo/services/public/interfaces/view_manager/view_manager.mojom.h"
12 12
13 namespace mojo { 13 namespace mojo {
14 namespace examples { 14 namespace examples {
15 15
16 class DemoLauncher : public ApplicationDelegate { 16 class DemoLauncher : public ApplicationDelegate {
17 public: 17 public:
18 DemoLauncher() {} 18 DemoLauncher() {}
19 virtual ~DemoLauncher() {} 19 virtual ~DemoLauncher() {}
20 20
21 private: 21 private:
22 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { 22 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE {
23 app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_); 23 app->ConnectToService("mojo:mojo_view_manager", &view_manager_init_);
24 } 24 }
25 25
26 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) 26 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection)
27 MOJO_OVERRIDE { 27 MOJO_OVERRIDE {
28 view_manager_init_->EmbedRoot("mojo:mojo_window_manager", 28 view_manager_init_->Embed("mojo:mojo_window_manager",
29 base::Bind(&DemoLauncher::OnConnect, 29 base::Bind(&DemoLauncher::OnConnect,
30 base::Unretained(this))); 30 base::Unretained(this)));
31 return true; 31 return true;
32 } 32 }
33 33
34 void OnConnect(bool success) {} 34 void OnConnect(bool success) {}
35 35
36 view_manager::ViewManagerInitServicePtr view_manager_init_; 36 view_manager::ViewManagerInitServicePtr view_manager_init_;
37 37
38 DISALLOW_COPY_AND_ASSIGN(DemoLauncher); 38 DISALLOW_COPY_AND_ASSIGN(DemoLauncher);
39 }; 39 };
40 40
41 } // namespace examples 41 } // namespace examples
42 42
43 // static 43 // static
44 ApplicationDelegate* ApplicationDelegate::Create() { 44 ApplicationDelegate* ApplicationDelegate::Create() {
45 return new examples::DemoLauncher; 45 return new examples::DemoLauncher;
46 } 46 }
47 47
48 } // namespace mojo 48 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/examples/aura_demo/view_manager_init.cc ('k') | mojo/examples/window_manager/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698