| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/printing/cloud_print/cloud_print_setup_source.h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_setup_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_FLOW_HTML)); | 119 .GetRawDataResource(IDR_CLOUD_PRINT_SETUP_FLOW_HTML)); |
| 120 response = html.as_string(); | 120 response = html.as_string(); |
| 121 } | 121 } |
| 122 // Send the response. | 122 // Send the response. |
| 123 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 123 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
| 124 html_bytes->data.resize(response.size()); | 124 html_bytes->data.resize(response.size()); |
| 125 std::copy(response.begin(), response.end(), html_bytes->data.begin()); | 125 std::copy(response.begin(), response.end(), html_bytes->data.begin()); |
| 126 SendResponse(request_id, html_bytes); | 126 SendResponse(request_id, html_bytes); |
| 127 } | 127 } |
| 128 | 128 |
| 129 std::string CloudPrintSetupSource::GetMimeType(const std::string& path) const { |
| 130 return "text/html"; |
| 131 } |
| 132 |
| 129 std::string CloudPrintSetupSource::GetLocalizedUrl( | 133 std::string CloudPrintSetupSource::GetLocalizedUrl( |
| 130 const std::string& url) const { | 134 const std::string& url) const { |
| 131 GURL original_url(url); | 135 GURL original_url(url); |
| 132 DCHECK(original_url.is_valid()); | 136 DCHECK(original_url.is_valid()); |
| 133 GURL localized_url = google_util::AppendGoogleLocaleParam(original_url); | 137 GURL localized_url = google_util::AppendGoogleLocaleParam(original_url); |
| 134 return localized_url.spec(); | 138 return localized_url.spec(); |
| 135 } | 139 } |
| OLD | NEW |