| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/runner/context.h" | 5 #include "mojo/runner/context.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 return true; | 103 return true; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void InitContentHandlers(shell::ApplicationManager* manager, | 106 void InitContentHandlers(shell::ApplicationManager* manager, |
| 107 const base::CommandLine& command_line) { | 107 const base::CommandLine& command_line) { |
| 108 // Default content handlers. | 108 // Default content handlers. |
| 109 manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer")); | 109 manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer")); |
| 110 manager->RegisterContentHandler("image/png", GURL("mojo:png_viewer")); | 110 manager->RegisterContentHandler("image/png", GURL("mojo:png_viewer")); |
| 111 manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); | 111 manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); |
| 112 | 112 |
| 113 // TODO(erg): We should probably handle this differently; these could be |
| 114 // autogenerated from package manifests. |
| 115 manager->RegisterApplicationPackageRedirect(GURL("mojo:clipboard"), |
| 116 GURL("mojo:core_services")); |
| 117 |
| 113 // Command-line-specified content handlers. | 118 // Command-line-specified content handlers. |
| 114 std::string handlers_spec = | 119 std::string handlers_spec = |
| 115 command_line.GetSwitchValueASCII(switches::kContentHandlers); | 120 command_line.GetSwitchValueASCII(switches::kContentHandlers); |
| 116 if (handlers_spec.empty()) | 121 if (handlers_spec.empty()) |
| 117 return; | 122 return; |
| 118 | 123 |
| 119 #if defined(OS_ANDROID) | 124 #if defined(OS_ANDROID) |
| 120 // TODO(eseidel): On Android we pass command line arguments is via the | 125 // TODO(eseidel): On Android we pass command line arguments is via the |
| 121 // 'parameters' key on the intent, which we specify during 'am shell start' | 126 // 'parameters' key on the intent, which we specify during 'am shell start' |
| 122 // via --esa, however that expects comma-separated values and says: | 127 // via --esa, however that expects comma-separated values and says: |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { | 322 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { |
| 318 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 323 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
| 319 task_runners_->shell_runner()); | 324 task_runners_->shell_runner()); |
| 320 base::MessageLoop::current()->Quit(); | 325 base::MessageLoop::current()->Quit(); |
| 321 } | 326 } |
| 322 } | 327 } |
| 323 } | 328 } |
| 324 | 329 |
| 325 } // namespace runner | 330 } // namespace runner |
| 326 } // namespace mojo | 331 } // namespace mojo |
| OLD | NEW |