OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/chromeos/enterprise_enrollment_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/enterprise_enrollment_ui.h" |
6 | 6 |
7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 AddString(&strings, "invalidaccesscode", | 236 AddString(&strings, "invalidaccesscode", |
237 IDS_SYNC_INVALID_ACCESS_CODE_LABEL); | 237 IDS_SYNC_INVALID_ACCESS_CODE_LABEL); |
238 AddString(&strings, "enteraccesscode", IDS_SYNC_ENTER_ACCESS_CODE_LABEL); | 238 AddString(&strings, "enteraccesscode", IDS_SYNC_ENTER_ACCESS_CODE_LABEL); |
239 | 239 |
240 static const base::StringPiece html(resource_bundle.GetRawDataResource( | 240 static const base::StringPiece html(resource_bundle.GetRawDataResource( |
241 IDR_GAIA_LOGIN_HTML)); | 241 IDR_GAIA_LOGIN_HTML)); |
242 SetFontAndTextDirection(&strings); | 242 SetFontAndTextDirection(&strings); |
243 response = jstemplate_builder::GetI18nTemplateHtml(html, &strings); | 243 response = jstemplate_builder::GetI18nTemplateHtml(html, &strings); |
244 } | 244 } |
245 | 245 |
246 // Send the response. | 246 SendResponse(request_id, base::RefCountedString::TakeString(&response)); |
247 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes()); | |
248 html_bytes->data.resize(response.size()); | |
249 std::copy(response.begin(), response.end(), html_bytes->data.begin()); | |
250 SendResponse(request_id, html_bytes); | |
251 } | 247 } |
252 | 248 |
253 std::string EnterpriseEnrollmentDataSource::GetMimeType( | 249 std::string EnterpriseEnrollmentDataSource::GetMimeType( |
254 const std::string& path) const { | 250 const std::string& path) const { |
255 return "text/html"; | 251 return "text/html"; |
256 } | 252 } |
257 | 253 |
258 EnterpriseEnrollmentDataSource::~EnterpriseEnrollmentDataSource() {} | 254 EnterpriseEnrollmentDataSource::~EnterpriseEnrollmentDataSource() {} |
259 | 255 |
260 void EnterpriseEnrollmentDataSource::AddString(DictionaryValue* dictionary, | 256 void EnterpriseEnrollmentDataSource::AddString(DictionaryValue* dictionary, |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 // static | 312 // static |
317 void EnterpriseEnrollmentUI::SetController( | 313 void EnterpriseEnrollmentUI::SetController( |
318 TabContents* contents, | 314 TabContents* contents, |
319 EnterpriseEnrollmentUI::Controller* controller) { | 315 EnterpriseEnrollmentUI::Controller* controller) { |
320 g_enrollment_ui_controller_property.Get().SetProperty( | 316 g_enrollment_ui_controller_property.Get().SetProperty( |
321 contents->property_bag(), | 317 contents->property_bag(), |
322 controller); | 318 controller); |
323 } | 319 } |
324 | 320 |
325 } // namespace chromeos | 321 } // namespace chromeos |
OLD | NEW |