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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 class EmbedApplicationLoader : public ApplicationLoader, | 415 class EmbedApplicationLoader : public ApplicationLoader, |
416 ApplicationDelegate, | 416 ApplicationDelegate, |
417 public InterfaceFactory<ViewManagerClient> { | 417 public InterfaceFactory<ViewManagerClient> { |
418 public: | 418 public: |
419 EmbedApplicationLoader() {} | 419 EmbedApplicationLoader() {} |
420 ~EmbedApplicationLoader() override {} | 420 ~EmbedApplicationLoader() override {} |
421 | 421 |
422 // ApplicationLoader implementation: | 422 // ApplicationLoader implementation: |
423 void Load(ApplicationManager* manager, | 423 void Load(ApplicationManager* manager, |
424 const GURL& url, | 424 const GURL& url, |
425 scoped_refptr<LoadCallbacks> callbacks) override { | 425 ScopedMessagePipeHandle shell_handle, |
426 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | 426 LoadCallback callback) override { |
427 if (!shell_handle.is_valid()) | 427 ASSERT_TRUE(shell_handle.is_valid()); |
428 return; | 428 scoped_ptr<ApplicationImpl> app( |
429 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, | 429 new ApplicationImpl(this, shell_handle.Pass())); |
430 shell_handle.Pass())); | |
431 apps_.push_back(app.release()); | 430 apps_.push_back(app.release()); |
432 } | 431 } |
433 void OnApplicationError(ApplicationManager* manager, | 432 void OnApplicationError(ApplicationManager* manager, |
434 const GURL& url) override {} | 433 const GURL& url) override {} |
435 | 434 |
436 // ApplicationDelegate implementation: | 435 // ApplicationDelegate implementation: |
437 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { | 436 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { |
438 connection->AddService<ViewManagerClient>(this); | 437 connection->AddService<ViewManagerClient>(this); |
439 return true; | 438 return true; |
440 } | 439 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 public ApplicationDelegate, | 509 public ApplicationDelegate, |
511 public InterfaceFactory<WindowManager> { | 510 public InterfaceFactory<WindowManager> { |
512 public: | 511 public: |
513 explicit WindowManagerLoader(EmbedApplicationLoader* app_loader) | 512 explicit WindowManagerLoader(EmbedApplicationLoader* app_loader) |
514 : app_loader_(app_loader) {} | 513 : app_loader_(app_loader) {} |
515 virtual ~WindowManagerLoader() {} | 514 virtual ~WindowManagerLoader() {} |
516 | 515 |
517 // ApplicationLoader implementation: | 516 // ApplicationLoader implementation: |
518 virtual void Load(ApplicationManager* manager, | 517 virtual void Load(ApplicationManager* manager, |
519 const GURL& url, | 518 const GURL& url, |
520 scoped_refptr<LoadCallbacks> callbacks) override { | 519 ScopedMessagePipeHandle shell_handle, |
521 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); | 520 LoadCallback callback) override { |
522 if (!shell_handle.is_valid()) | 521 ASSERT_TRUE(shell_handle.is_valid()); |
523 return; | |
524 scoped_ptr<ApplicationImpl> app( | 522 scoped_ptr<ApplicationImpl> app( |
525 new ApplicationImpl(this, shell_handle.Pass())); | 523 new ApplicationImpl(this, shell_handle.Pass())); |
526 apps_.push_back(app.release()); | 524 apps_.push_back(app.release()); |
527 } | 525 } |
528 virtual void OnApplicationError(ApplicationManager* manager, | 526 virtual void OnApplicationError(ApplicationManager* manager, |
529 const GURL& url) override {} | 527 const GURL& url) override {} |
530 | 528 |
531 // ApplicationDelegate implementation: | 529 // ApplicationDelegate implementation: |
532 virtual bool ConfigureIncomingConnection( | 530 virtual bool ConfigureIncomingConnection( |
533 ApplicationConnection* connection) override { | 531 ApplicationConnection* connection) override { |
(...skipping 1083 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 EXPECT_EQ("PropertyChanged view=1,1 key=one value=NULL", | 1615 EXPECT_EQ("PropertyChanged view=1,1 key=one value=NULL", |
1618 ChangesToDescription1(connection2_->changes())[0]); | 1616 ChangesToDescription1(connection2_->changes())[0]); |
1619 } | 1617 } |
1620 } | 1618 } |
1621 | 1619 |
1622 // WARNING: this class is deprecated and will be replaced with | 1620 // WARNING: this class is deprecated and will be replaced with |
1623 // view_manager_server_apptest soonish. Add new tests there. | 1621 // view_manager_server_apptest soonish. Add new tests there. |
1624 | 1622 |
1625 } // namespace service | 1623 } // namespace service |
1626 } // namespace mojo | 1624 } // namespace mojo |
OLD | NEW |