| 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 "shell/application_manager/application_manager.h" | 5 #include "shell/application_manager/application_manager.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "mojo/public/cpp/bindings/binding.h" | 15 #include "mojo/public/cpp/bindings/binding.h" |
| 16 #include "mojo/public/cpp/bindings/error_handler.h" | 16 #include "mojo/public/cpp/bindings/error_handler.h" |
| 17 #include "mojo/public/interfaces/application/shell.mojom.h" | 17 #include "mojo/public/interfaces/application/shell.mojom.h" |
| 18 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" | 18 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" |
| 19 #include "shell/application_manager/fetcher.h" | 19 #include "shell/application_manager/fetcher.h" |
| 20 #include "shell/application_manager/local_fetcher.h" | 20 #include "shell/application_manager/local_fetcher.h" |
| 21 #include "shell/application_manager/network_fetcher.h" | 21 #include "shell/application_manager/network_fetcher.h" |
| 22 #include "shell/application_manager/query_util.h" |
| 22 | 23 |
| 23 namespace mojo { | 24 namespace mojo { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 // Used by TestAPI. | 27 // Used by TestAPI. |
| 27 bool has_created_instance = false; | 28 bool has_created_instance = false; |
| 28 | 29 |
| 29 GURL StripQueryFromURL(const GURL& url) { | |
| 30 GURL::Replacements repl; | |
| 31 repl.SetQueryStr(""); | |
| 32 std::string result = url.ReplaceComponents(repl).spec(); | |
| 33 | |
| 34 // Remove the dangling '?' because it's ugly. | |
| 35 base::ReplaceChars(result, "?", "", &result); | |
| 36 return GURL(result); | |
| 37 } | |
| 38 | |
| 39 } // namespace | 30 } // namespace |
| 40 | 31 |
| 41 ApplicationManager::Delegate::~Delegate() { | 32 ApplicationManager::Delegate::~Delegate() { |
| 42 } | 33 } |
| 43 | 34 |
| 44 void ApplicationManager::Delegate::OnApplicationError(const GURL& url) { | 35 void ApplicationManager::Delegate::OnApplicationError(const GURL& url) { |
| 45 LOG(ERROR) << "Communication error with application: " << url.spec(); | 36 LOG(ERROR) << "Communication error with application: " << url.spec(); |
| 46 } | 37 } |
| 47 | 38 |
| 48 GURL ApplicationManager::Delegate::ResolveURL(const GURL& url) { | 39 GURL ApplicationManager::Delegate::ResolveURL(const GURL& url) { |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 return Array<String>::From(args_it->second); | 429 return Array<String>::From(args_it->second); |
| 439 return Array<String>(); | 430 return Array<String>(); |
| 440 } | 431 } |
| 441 | 432 |
| 442 void ApplicationManager::CleanupRunner(NativeRunner* runner) { | 433 void ApplicationManager::CleanupRunner(NativeRunner* runner) { |
| 443 native_runners_.erase( | 434 native_runners_.erase( |
| 444 std::find(native_runners_.begin(), native_runners_.end(), runner)); | 435 std::find(native_runners_.begin(), native_runners_.end(), runner)); |
| 445 } | 436 } |
| 446 | 437 |
| 447 } // namespace mojo | 438 } // namespace mojo |
| OLD | NEW |