| 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/shell/context.h" | 5 #include "mojo/shell/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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 DISALLOW_COPY_AND_ASSIGN(Setup); | 64 DISALLOW_COPY_AND_ASSIGN(Setup); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER; | 67 static base::LazyInstance<Setup>::Leaky setup = LAZY_INSTANCE_INITIALIZER; |
| 68 | 68 |
| 69 void InitContentHandlers(DynamicApplicationLoader* loader, | 69 void InitContentHandlers(DynamicApplicationLoader* loader, |
| 70 base::CommandLine* command_line) { | 70 base::CommandLine* command_line) { |
| 71 // Default content handlers. | 71 // Default content handlers. |
| 72 loader->RegisterContentHandler("application/pdf", GURL("mojo://pdf_viewer/")); | 72 loader->RegisterContentHandler("application/pdf", GURL("mojo:pdf_viewer/")); |
| 73 loader->RegisterContentHandler("image/png", GURL("mojo://png_viewer/")); | 73 loader->RegisterContentHandler("image/png", GURL("mojo:png_viewer/")); |
| 74 loader->RegisterContentHandler("text/html", GURL("mojo://html_viewer/")); | 74 loader->RegisterContentHandler("text/html", GURL("mojo:html_viewer/")); |
| 75 | 75 |
| 76 // Command-line-specified content handlers. | 76 // Command-line-specified content handlers. |
| 77 std::string handlers_spec = command_line->GetSwitchValueASCII( | 77 std::string handlers_spec = command_line->GetSwitchValueASCII( |
| 78 switches::kContentHandlers); | 78 switches::kContentHandlers); |
| 79 if (handlers_spec.empty()) | 79 if (handlers_spec.empty()) |
| 80 return; | 80 return; |
| 81 | 81 |
| 82 std::vector<std::string> parts; | 82 std::vector<std::string> parts; |
| 83 base::SplitString(handlers_spec, ',', &parts); | 83 base::SplitString(handlers_spec, ',', &parts); |
| 84 if (parts.size() % 2 != 0) { | 84 if (parts.size() % 2 != 0) { |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 ScopedMessagePipeHandle Context::ConnectToServiceByName( | 262 ScopedMessagePipeHandle Context::ConnectToServiceByName( |
| 263 const GURL& application_url, | 263 const GURL& application_url, |
| 264 const std::string& service_name) { | 264 const std::string& service_name) { |
| 265 app_urls_.insert(application_url); | 265 app_urls_.insert(application_url); |
| 266 return application_manager_.ConnectToServiceByName( | 266 return application_manager_.ConnectToServiceByName( |
| 267 application_url, service_name).Pass(); | 267 application_url, service_name).Pass(); |
| 268 } | 268 } |
| 269 | 269 |
| 270 } // namespace shell | 270 } // namespace shell |
| 271 } // namespace mojo | 271 } // namespace mojo |
| OLD | NEW |