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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "examples/recipes/window_manager/window_manager.h" | 7 #include "examples/recipes/window_manager/window_manager.h" |
8 #include "mojo/application/application_runner_chromium.h" | 8 #include "mojo/application/application_runner_chromium.h" |
9 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 window_manager_app_->Initialize(impl); | 35 window_manager_app_->Initialize(impl); |
36 } | 36 } |
37 bool ConfigureIncomingConnection( | 37 bool ConfigureIncomingConnection( |
38 mojo::ApplicationConnection* connection) override { | 38 mojo::ApplicationConnection* connection) override { |
39 window_manager_app_->ConfigureIncomingConnection(connection); | 39 window_manager_app_->ConfigureIncomingConnection(connection); |
40 return true; | 40 return true; |
41 } | 41 } |
42 | 42 |
43 // Overridden from mojo::ViewManagerDelegate: | 43 // Overridden from mojo::ViewManagerDelegate: |
44 void OnEmbed( | 44 void OnEmbed( |
45 mojo::ViewManager* view_manager, | |
46 mojo::View* root, | 45 mojo::View* root, |
47 mojo::ServiceProviderImpl* exported_services, | 46 mojo::ServiceProviderImpl* exported_services, |
48 scoped_ptr<mojo::ServiceProvider> remote_service_provider) override { | 47 scoped_ptr<mojo::ServiceProvider> remote_service_provider) override { |
49 window_manager_.reset(new WindowManager(root)); | 48 window_manager_.reset(new WindowManager(root)); |
50 | 49 |
51 window_manager_app_->InitFocus( | 50 window_manager_app_->InitFocus( |
52 make_scoped_ptr(new ::window_manager::BasicFocusRules(root))); | 51 make_scoped_ptr(new ::window_manager::BasicFocusRules(root))); |
53 } | 52 } |
54 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override { | 53 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override { |
55 // TODO(sky): quit here? | 54 // TODO(sky): quit here? |
(...skipping 20 matching lines...) Expand all Loading... |
76 DISALLOW_COPY_AND_ASSIGN(Main); | 75 DISALLOW_COPY_AND_ASSIGN(Main); |
77 }; | 76 }; |
78 | 77 |
79 } // window_manager | 78 } // window_manager |
80 } // recipes | 79 } // recipes |
81 | 80 |
82 MojoResult MojoMain(MojoHandle shell_handle) { | 81 MojoResult MojoMain(MojoHandle shell_handle) { |
83 mojo::ApplicationRunnerChromium runner(new recipes::window_manager::Main); | 82 mojo::ApplicationRunnerChromium runner(new recipes::window_manager::Main); |
84 return runner.Run(shell_handle); | 83 return runner.Run(shell_handle); |
85 } | 84 } |
OLD | NEW |