| 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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/string_tokenizer.h" | 8 #include "base/strings/string_tokenizer.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 void LaunchInstance::OnReceivedResponse(URLResponsePtr response) { | 160 void LaunchInstance::OnReceivedResponse(URLResponsePtr response) { |
| 161 if (!response->error) { | 161 if (!response->error) { |
| 162 std::string content_type = GetContentType(response->headers); | 162 std::string content_type = GetContentType(response->headers); |
| 163 std::string handler_url = app_->GetHandlerForContentType(content_type); | 163 std::string handler_url = app_->GetHandlerForContentType(content_type); |
| 164 if (handler_url.empty()) { | 164 if (handler_url.empty()) { |
| 165 DLOG(WARNING) << "No handler for content type: " << content_type; | 165 DLOG(WARNING) << "No handler for content type: " << content_type; |
| 166 } else { | 166 } else { |
| 167 navigation::ResponseDetailsPtr nav_response( | 167 navigation::ResponseDetailsPtr nav_response( |
| 168 navigation::ResponseDetails::New()); | 168 navigation::ResponseDetails::New()); |
| 169 nav_response->loader_handle = url_loader_.PassMessagePipe(); | 169 nav_response->loader = url_loader_.Pass(); |
| 170 nav_response->response = response.Pass(); | 170 nav_response->response = response.Pass(); |
| 171 String response_url = nav_response->response->url; | 171 String response_url = nav_response->response->url; |
| 172 callback_.Run(handler_url, response_url, nav_response.Pass()); | 172 callback_.Run(handler_url, response_url, nav_response.Pass()); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 ScheduleDestroy(); | 175 ScheduleDestroy(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 } // namespace launcher | 178 } // namespace launcher |
| 179 | 179 |
| 180 // static | 180 // static |
| 181 ApplicationDelegate* ApplicationDelegate::Create() { | 181 ApplicationDelegate* ApplicationDelegate::Create() { |
| 182 return new launcher::LauncherApp; | 182 return new launcher::LauncherApp; |
| 183 } | 183 } |
| 184 | 184 |
| 185 } // namespace mojo | 185 } // namespace mojo |
| OLD | NEW |