OLD | NEW |
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/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "mojo/application/application_runner_chromium.h" | 9 #include "mojo/application/application_runner_chromium.h" |
10 #include "mojo/examples/window_manager/window_manager.mojom.h" | 10 #include "mojo/examples/window_manager/window_manager.mojom.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 class NestingApp | 35 class NestingApp |
36 : public ApplicationDelegate, | 36 : public ApplicationDelegate, |
37 public ViewManagerDelegate, | 37 public ViewManagerDelegate, |
38 public ViewObserver { | 38 public ViewObserver { |
39 public: | 39 public: |
40 NestingApp() : nested_(NULL) {} | 40 NestingApp() : nested_(NULL) {} |
41 virtual ~NestingApp() {} | 41 virtual ~NestingApp() {} |
42 | 42 |
43 private: | 43 private: |
44 // Overridden from ApplicationDelegate: | 44 // Overridden from ApplicationDelegate: |
45 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { | 45 virtual void Initialize(ApplicationImpl* app) override { |
46 view_manager_client_factory_.reset( | 46 view_manager_client_factory_.reset( |
47 new ViewManagerClientFactory(app->shell(), this)); | 47 new ViewManagerClientFactory(app->shell(), this)); |
48 } | 48 } |
49 | 49 |
50 // Overridden from ApplicationImpl: | 50 // Overridden from ApplicationImpl: |
51 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 51 virtual bool ConfigureIncomingConnection( |
52 MOJO_OVERRIDE { | 52 ApplicationConnection* connection) override { |
53 connection->ConnectToService(&window_manager_); | 53 connection->ConnectToService(&window_manager_); |
54 connection->AddService(view_manager_client_factory_.get()); | 54 connection->AddService(view_manager_client_factory_.get()); |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 // Overridden from ViewManagerDelegate: | 58 // Overridden from ViewManagerDelegate: |
59 virtual void OnEmbed(ViewManager* view_manager, | 59 virtual void OnEmbed(ViewManager* view_manager, |
60 View* root, | 60 View* root, |
61 ServiceProviderImpl* exported_services, | 61 ServiceProviderImpl* exported_services, |
62 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { | 62 scoped_ptr<ServiceProvider> imported_services) OVERRIDE { |
(...skipping 27 matching lines...) Expand all Loading... |
90 DISALLOW_COPY_AND_ASSIGN(NestingApp); | 90 DISALLOW_COPY_AND_ASSIGN(NestingApp); |
91 }; | 91 }; |
92 | 92 |
93 } // namespace examples | 93 } // namespace examples |
94 } // namespace mojo | 94 } // namespace mojo |
95 | 95 |
96 MojoResult MojoMain(MojoHandle shell_handle) { | 96 MojoResult MojoMain(MojoHandle shell_handle) { |
97 mojo::ApplicationRunnerChromium runner(new mojo::examples::NestingApp); | 97 mojo::ApplicationRunnerChromium runner(new mojo::examples::NestingApp); |
98 return runner.Run(shell_handle); | 98 return runner.Run(shell_handle); |
99 } | 99 } |
OLD | NEW |