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 "chrome/browser/chromeos/app_mode/fake_cws.h" | 5 #include "chrome/browser/chromeos/app_mode/fake_cws.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 scoped_ptr<HttpResponse> FakeCWS::HandleRequest(const HttpRequest& request) { | 132 scoped_ptr<HttpResponse> FakeCWS::HandleRequest(const HttpRequest& request) { |
133 GURL request_url = GURL("http://localhost").Resolve(request.relative_url); | 133 GURL request_url = GURL("http://localhost").Resolve(request.relative_url); |
134 std::string request_path = request_url.path(); | 134 std::string request_path = request_url.path(); |
135 if (!update_check_content_.empty() && | 135 if (!update_check_content_.empty() && |
136 request_path.find("/update_check.xml") != std::string::npos) { | 136 request_path.find("/update_check.xml") != std::string::npos) { |
137 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse()); | 137 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse()); |
138 http_response->set_code(net::HTTP_OK); | 138 http_response->set_code(net::HTTP_OK); |
139 http_response->set_content_type("text/xml"); | 139 http_response->set_content_type("text/xml"); |
140 http_response->set_content(update_check_content_); | 140 http_response->set_content(update_check_content_); |
141 return http_response.PassAs<HttpResponse>(); | 141 return http_response.Pass(); |
142 } | 142 } |
143 | 143 |
144 return scoped_ptr<HttpResponse>(); | 144 return scoped_ptr<HttpResponse>(); |
145 } | 145 } |
146 | 146 |
147 } // namespace chromeos | 147 } // namespace chromeos |
OLD | NEW |