| 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/strings/string_tokenizer.h" | 7 #include "base/strings/string_tokenizer.h" |
| 8 #include "mojo/public/cpp/application/application.h" | 8 #include "mojo/public/cpp/application/application.h" |
| 9 #include "mojo/services/public/cpp/view_manager/types.h" | 9 #include "mojo/services/public/cpp/view_manager/types.h" |
| 10 #include "mojo/services/public/interfaces/launcher/launcher.mojom.h" | 10 #include "mojo/services/public/interfaces/launcher/launcher.mojom.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 DataPipe data_pipe; | 138 DataPipe data_pipe; |
| 139 response_body_stream_ = data_pipe.consumer_handle.Pass(); | 139 response_body_stream_ = data_pipe.consumer_handle.Pass(); |
| 140 | 140 |
| 141 url_loader_->Start(request.Pass(), data_pipe.producer_handle.Pass()); | 141 url_loader_->Start(request.Pass(), data_pipe.producer_handle.Pass()); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void LaunchInstance::OnReceivedResponse(URLResponsePtr response) { | 144 void LaunchInstance::OnReceivedResponse(URLResponsePtr response) { |
| 145 std::string content_type = GetContentType(response->headers); | 145 std::string content_type = GetContentType(response->headers); |
| 146 std::string handler_url = app_->GetHandlerForContentType(content_type); | 146 std::string handler_url = app_->GetHandlerForContentType(content_type); |
| 147 if (!handler_url.empty()) { | 147 if (!handler_url.empty()) { |
| 148 navigation::ResponseDetailsPtr response_details = | 148 client_->OnLaunch(handler_url, response.Pass(), |
| 149 navigation::ResponseDetails::New(); | 149 response_body_stream_.Pass()); |
| 150 response_details->response = response.Pass(); | |
| 151 response_details->response_body_stream = response_body_stream_.Pass(); | |
| 152 | |
| 153 client_->OnLaunch(handler_url, response_details.Pass()); | |
| 154 } | 150 } |
| 155 } | 151 } |
| 156 | 152 |
| 157 } // namespace launcher | 153 } // namespace launcher |
| 158 | 154 |
| 159 // static | 155 // static |
| 160 Application* Application::Create() { | 156 Application* Application::Create() { |
| 161 return new launcher::LauncherApp; | 157 return new launcher::LauncherApp; |
| 162 } | 158 } |
| 163 | 159 |
| 164 } // namespace mojo | 160 } // namespace mojo |
| OLD | NEW |