| 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 "mojo/services/public/cpp/view_manager/view_manager.h" | 5 #include "mojo/services/public/cpp/view_manager/view_manager.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 ASSERT_TRUE(EmbedRoot(view_manager_init_.get(), kWindowManagerURL)); | 369 ASSERT_TRUE(EmbedRoot(view_manager_init_.get(), kWindowManagerURL)); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void EmbedRootCallback(bool* result_cache, bool result) { | 372 void EmbedRootCallback(bool* result_cache, bool result) { |
| 373 *result_cache = result; | 373 *result_cache = result; |
| 374 } | 374 } |
| 375 | 375 |
| 376 bool EmbedRoot(ViewManagerInitService* view_manager_init, | 376 bool EmbedRoot(ViewManagerInitService* view_manager_init, |
| 377 const std::string& url) { | 377 const std::string& url) { |
| 378 bool result = false; | 378 bool result = false; |
| 379 view_manager_init->EmbedRoot( | 379 view_manager_init->Embed( |
| 380 url, | 380 url, |
| 381 base::Bind(&ViewManagerTest::EmbedRootCallback, base::Unretained(this), | 381 base::Bind(&ViewManagerTest::EmbedRootCallback, base::Unretained(this), |
| 382 &result)); | 382 &result)); |
| 383 RunRunLoop(); | 383 RunRunLoop(); |
| 384 window_manager_ = GetLoadedViewManager(); | 384 window_manager_ = GetLoadedViewManager(); |
| 385 return result; | 385 return result; |
| 386 } | 386 } |
| 387 | 387 |
| 388 void OnViewManagerLoaded(ViewManager* view_manager, Node* root) { | 388 void OnViewManagerLoaded(ViewManager* view_manager, Node* root) { |
| 389 loaded_view_manager_ = view_manager; | 389 loaded_view_manager_ = view_manager; |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 // TODO(beng): tests for view event dispatcher. | 768 // TODO(beng): tests for view event dispatcher. |
| 769 // - verify that we see events for all views. | 769 // - verify that we see events for all views. |
| 770 | 770 |
| 771 // TODO(beng): tests for focus: | 771 // TODO(beng): tests for focus: |
| 772 // - focus between two nodes known to a connection | 772 // - focus between two nodes known to a connection |
| 773 // - focus between nodes unknown to one of the connections. | 773 // - focus between nodes unknown to one of the connections. |
| 774 // - focus between nodes unknown to either connection. | 774 // - focus between nodes unknown to either connection. |
| 775 | 775 |
| 776 } // namespace view_manager | 776 } // namespace view_manager |
| 777 } // namespace mojo | 777 } // namespace mojo |
| OLD | NEW |