| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 ~Setup() {} | 56 ~Setup() {} |
| 57 | 57 |
| 58 private: | 58 private: |
| 59 DISALLOW_COPY_AND_ASSIGN(Setup); | 59 DISALLOW_COPY_AND_ASSIGN(Setup); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 void InitContentHandlers(package_manager::PackageManagerImpl* manager, | 62 void InitContentHandlers(package_manager::PackageManagerImpl* manager, |
| 63 const base::CommandLine& command_line) { | 63 const base::CommandLine& command_line) { |
| 64 // Default content handlers. | 64 // Default content handlers. |
| 65 manager->RegisterContentHandler("application/javascript", |
| 66 GURL("mojo:html_viewer")); |
| 65 manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer")); | 67 manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer")); |
| 68 manager->RegisterContentHandler("image/gif", GURL("mojo:html_viewer")); |
| 69 manager->RegisterContentHandler("image/jpeg", GURL("mojo:html_viewer")); |
| 66 manager->RegisterContentHandler("image/png", GURL("mojo:png_viewer")); | 70 manager->RegisterContentHandler("image/png", GURL("mojo:png_viewer")); |
| 71 manager->RegisterContentHandler("text/css", GURL("mojo:html_viewer")); |
| 67 manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); | 72 manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); |
| 68 manager->RegisterContentHandler("text/plain", GURL("mojo:html_viewer")); | 73 manager->RegisterContentHandler("text/plain", GURL("mojo:html_viewer")); |
| 69 | 74 |
| 70 // Command-line-specified content handlers. | 75 // Command-line-specified content handlers. |
| 71 std::string handlers_spec = | 76 std::string handlers_spec = |
| 72 command_line.GetSwitchValueASCII(switches::kContentHandlers); | 77 command_line.GetSwitchValueASCII(switches::kContentHandlers); |
| 73 if (handlers_spec.empty()) | 78 if (handlers_spec.empty()) |
| 74 return; | 79 return; |
| 75 | 80 |
| 76 #if defined(OS_ANDROID) | 81 #if defined(OS_ANDROID) |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 base::MessageLoop::current()->Quit(); | 306 base::MessageLoop::current()->Quit(); |
| 302 } else { | 307 } else { |
| 303 app_complete_callback_.Run(); | 308 app_complete_callback_.Run(); |
| 304 } | 309 } |
| 305 } | 310 } |
| 306 } | 311 } |
| 307 } | 312 } |
| 308 | 313 |
| 309 } // namespace runner | 314 } // namespace runner |
| 310 } // namespace mojo | 315 } // namespace mojo |
| OLD | NEW |