| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/memory/scoped_vector.h" | 7 #include "base/memory/scoped_vector.h" |
| 8 #include "mojo/application_manager/application_manager.h" | 8 #include "mojo/application_manager/application_manager.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" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 new mojo::ViewManagerClientFactory(app->shell(), this)); | 98 new mojo::ViewManagerClientFactory(app->shell(), this)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 bool ConfigureIncomingConnection( | 101 bool ConfigureIncomingConnection( |
| 102 mojo::ApplicationConnection* connection) override { | 102 mojo::ApplicationConnection* connection) override { |
| 103 connection->AddService(view_manager_client_factory_.get()); | 103 connection->AddService(view_manager_client_factory_.get()); |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 // Overridden from mojo::ViewManagerDelegate: | 107 // Overridden from mojo::ViewManagerDelegate: |
| 108 void OnEmbed(mojo::ViewManager* view_manager, | 108 void OnEmbed(View* root, |
| 109 View* root, | |
| 110 mojo::ServiceProviderImpl* exported_services, | 109 mojo::ServiceProviderImpl* exported_services, |
| 111 scoped_ptr<mojo::ServiceProvider> imported_services) override { | 110 scoped_ptr<mojo::ServiceProvider> imported_services) override { |
| 112 root_added_callback_.Run(root); | 111 root_added_callback_.Run(root); |
| 113 } | 112 } |
| 114 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override {} | 113 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override {} |
| 115 | 114 |
| 116 RootAddedCallback root_added_callback_; | 115 RootAddedCallback root_added_callback_; |
| 117 | 116 |
| 118 ScopedVector<ApplicationImpl> apps_; | 117 ScopedVector<ApplicationImpl> apps_; |
| 119 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; | 118 scoped_ptr<mojo::ViewManagerClientFactory> view_manager_client_factory_; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 260 |
| 262 Id second_window = OpenWindow(); | 261 Id second_window = OpenWindow(); |
| 263 window_manager_->ActivateWindow(second_window, | 262 window_manager_->ActivateWindow(second_window, |
| 264 base::Bind(&EmptyResultCallback)); | 263 base::Bind(&EmptyResultCallback)); |
| 265 ids = WaitForActiveWindowChange(); | 264 ids = WaitForActiveWindowChange(); |
| 266 EXPECT_EQ(ids.first, first_window); | 265 EXPECT_EQ(ids.first, first_window); |
| 267 EXPECT_EQ(ids.second, second_window); | 266 EXPECT_EQ(ids.second, second_window); |
| 268 } | 267 } |
| 269 | 268 |
| 270 } // namespace window_manager | 269 } // namespace window_manager |
| OLD | NEW |