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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 private: | 58 private: |
59 DISALLOW_COPY_AND_ASSIGN(Setup); | 59 DISALLOW_COPY_AND_ASSIGN(Setup); |
60 }; | 60 }; |
61 | 61 |
62 void InitContentHandlers(shell::ApplicationManager* manager, | 62 void InitContentHandlers(shell::ApplicationManager* 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/pdf", GURL("mojo:pdf_viewer")); | 65 manager->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer")); |
66 manager->RegisterContentHandler("image/png", GURL("mojo:png_viewer")); | 66 manager->RegisterContentHandler("image/png", GURL("mojo:png_viewer")); |
67 manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); | 67 manager->RegisterContentHandler("text/html", GURL("mojo:html_viewer")); |
| 68 manager->RegisterContentHandler("text/plain", GURL("mojo:html_viewer")); |
68 | 69 |
69 // Command-line-specified content handlers. | 70 // Command-line-specified content handlers. |
70 std::string handlers_spec = | 71 std::string handlers_spec = |
71 command_line.GetSwitchValueASCII(switches::kContentHandlers); | 72 command_line.GetSwitchValueASCII(switches::kContentHandlers); |
72 if (handlers_spec.empty()) | 73 if (handlers_spec.empty()) |
73 return; | 74 return; |
74 | 75 |
75 #if defined(OS_ANDROID) | 76 #if defined(OS_ANDROID) |
76 // TODO(eseidel): On Android we pass command line arguments is via the | 77 // TODO(eseidel): On Android we pass command line arguments is via the |
77 // 'parameters' key on the intent, which we specify during 'am shell start' | 78 // 'parameters' key on the intent, which we specify during 'am shell start' |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 base::MessageLoop::current()->Quit(); | 311 base::MessageLoop::current()->Quit(); |
311 } else { | 312 } else { |
312 app_complete_callback_.Run(); | 313 app_complete_callback_.Run(); |
313 } | 314 } |
314 } | 315 } |
315 } | 316 } |
316 } | 317 } |
317 | 318 |
318 } // namespace runner | 319 } // namespace runner |
319 } // namespace mojo | 320 } // namespace mojo |
OLD | NEW |