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 <string> | 5 #include <string> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 // Used with ViewManagerService::Embed(). Creates a | 373 // Used with ViewManagerService::Embed(). Creates a |
374 // TestViewManagerClientConnection, which creates and owns the ViewManagerProxy. | 374 // TestViewManagerClientConnection, which creates and owns the ViewManagerProxy. |
375 class EmbedServiceLoader : public ServiceLoader, | 375 class EmbedServiceLoader : public ServiceLoader, |
376 ApplicationDelegate, | 376 ApplicationDelegate, |
377 public InterfaceFactory<ViewManagerClient> { | 377 public InterfaceFactory<ViewManagerClient> { |
378 public: | 378 public: |
379 EmbedServiceLoader() {} | 379 EmbedServiceLoader() {} |
380 virtual ~EmbedServiceLoader() {} | 380 virtual ~EmbedServiceLoader() {} |
381 | 381 |
382 // ServiceLoader implementation: | 382 // ServiceLoader implementation: |
383 virtual void Load(ServiceManager* manager, | 383 virtual void LoadService(ServiceManager* manager, |
384 const GURL& url, | 384 const GURL& url, |
385 scoped_refptr<LoadCallbacks> callbacks) OVERRIDE { | 385 ScopedMessagePipeHandle shell_handle) OVERRIDE { |
386 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | |
387 if (!shell_handle.is_valid()) | |
388 return; | |
389 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, | 386 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, |
390 shell_handle.Pass())); | 387 shell_handle.Pass())); |
391 apps_.push_back(app.release()); | 388 apps_.push_back(app.release()); |
392 } | 389 } |
393 virtual void OnServiceError(ServiceManager* manager, | 390 virtual void OnServiceError(ServiceManager* manager, |
394 const GURL& url) OVERRIDE { | 391 const GURL& url) OVERRIDE { |
395 } | 392 } |
396 | 393 |
397 // ApplicationDelegate implementation: | 394 // ApplicationDelegate implementation: |
398 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) | 395 virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1460 // that SetBounsdNodes/AddNode and the like don't result in messages to the | 1457 // that SetBounsdNodes/AddNode and the like don't result in messages to the |
1461 // originating connection. | 1458 // originating connection. |
1462 | 1459 |
1463 // TODO(beng): Add tests for focus: | 1460 // TODO(beng): Add tests for focus: |
1464 // - focus between two nodes known to a connection | 1461 // - focus between two nodes known to a connection |
1465 // - focus between nodes unknown to one of the connections. | 1462 // - focus between nodes unknown to one of the connections. |
1466 // - focus between nodes unknown to either connection. | 1463 // - focus between nodes unknown to either connection. |
1467 | 1464 |
1468 } // namespace service | 1465 } // namespace service |
1469 } // namespace mojo | 1466 } // namespace mojo |
OLD | NEW |