| 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/at_exit.h" | 5 #include "base/at_exit.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 GURL mapped_url = ResolveMappings(url); | 396 GURL mapped_url = ResolveMappings(url); |
| 397 // The shell automatically map mojo URLs. | 397 // The shell automatically map mojo URLs. |
| 398 if (mapped_url.scheme() == "mojo") { | 398 if (mapped_url.scheme() == "mojo") { |
| 399 url::Replacements<char> replacements; | 399 url::Replacements<char> replacements; |
| 400 replacements.SetScheme("file", url::Component(0, 4)); | 400 replacements.SetScheme("file", url::Component(0, 4)); |
| 401 mapped_url = mapped_url.ReplaceComponents(replacements); | 401 mapped_url = mapped_url.ReplaceComponents(replacements); |
| 402 } | 402 } |
| 403 return mapped_url; | 403 return mapped_url; |
| 404 } | 404 } |
| 405 | 405 |
| 406 void OnApplicationError(const GURL& url) override {} | |
| 407 | |
| 408 private: | 406 private: |
| 409 std::map<GURL, GURL> mappings_; | 407 std::map<GURL, GURL> mappings_; |
| 410 }; | 408 }; |
| 411 | 409 |
| 412 class TestExternal : public ApplicationDelegate { | 410 class TestExternal : public ApplicationDelegate { |
| 413 public: | 411 public: |
| 414 TestExternal() : configure_incoming_connection_called_(false) {} | 412 TestExternal() : configure_incoming_connection_called_(false) {} |
| 415 | 413 |
| 416 void Initialize(ApplicationImpl* app) override { | 414 void Initialize(ApplicationImpl* app) override { |
| 417 initialize_args_ = app->args(); | 415 initialize_args_ = app->args(); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 750 // test::test2 should go to scheme loader. | 748 // test::test2 should go to scheme loader. |
| 751 application_manager_->ConnectToService(GURL("test:test2?foo=bar"), | 749 application_manager_->ConnectToService(GURL("test:test2?foo=bar"), |
| 752 &test_service); | 750 &test_service); |
| 753 EXPECT_EQ(1, url_loader->num_loads()); | 751 EXPECT_EQ(1, url_loader->num_loads()); |
| 754 EXPECT_EQ(1, scheme_loader->num_loads()); | 752 EXPECT_EQ(1, scheme_loader->num_loads()); |
| 755 } | 753 } |
| 756 | 754 |
| 757 } // namespace | 755 } // namespace |
| 758 } // namespace shell | 756 } // namespace shell |
| 759 } // namespace mojo | 757 } // namespace mojo |
| OLD | NEW |