| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sim_unlock_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_MESSAGE)); | 310 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_MESSAGE)); |
| 311 strings.SetString("oldPin", l10n_util::GetStringUTF16( | 311 strings.SetString("oldPin", l10n_util::GetStringUTF16( |
| 312 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_OLD_PIN)); | 312 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_OLD_PIN)); |
| 313 | 313 |
| 314 web_ui_util::SetFontAndTextDirection(&strings); | 314 web_ui_util::SetFontAndTextDirection(&strings); |
| 315 | 315 |
| 316 static const base::StringPiece html( | 316 static const base::StringPiece html( |
| 317 ResourceBundle::GetSharedInstance().GetRawDataResource( | 317 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 318 IDR_SIM_UNLOCK_HTML)); | 318 IDR_SIM_UNLOCK_HTML)); |
| 319 | 319 |
| 320 std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html, | 320 std::string full_html = webui::GetI18nTemplateHtml(html, &strings); |
| 321 &strings); | |
| 322 | 321 |
| 323 callback.Run(base::RefCountedString::TakeString(&full_html)); | 322 callback.Run(base::RefCountedString::TakeString(&full_html)); |
| 324 } | 323 } |
| 325 | 324 |
| 326 // SimUnlockHandler ------------------------------------------------------------ | 325 // SimUnlockHandler ------------------------------------------------------------ |
| 327 | 326 |
| 328 SimUnlockHandler::SimUnlockHandler() | 327 SimUnlockHandler::SimUnlockHandler() |
| 329 : state_(SIM_UNLOCK_LOADING), | 328 : state_(SIM_UNLOCK_LOADING), |
| 330 dialog_mode_(SimDialogDelegate::SIM_DIALOG_UNLOCK), | 329 dialog_mode_(SimDialogDelegate::SIM_DIALOG_UNLOCK), |
| 331 pending_pin_operation_(false) { | 330 pending_pin_operation_(false) { |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 SimUnlockHandler* handler = new SimUnlockHandler(); | 677 SimUnlockHandler* handler = new SimUnlockHandler(); |
| 679 web_ui->AddMessageHandler(handler); | 678 web_ui->AddMessageHandler(handler); |
| 680 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); | 679 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); |
| 681 | 680 |
| 682 // Set up the chrome://sim-unlock/ source. | 681 // Set up the chrome://sim-unlock/ source. |
| 683 Profile* profile = Profile::FromWebUI(web_ui); | 682 Profile* profile = Profile::FromWebUI(web_ui); |
| 684 ChromeURLDataManager::AddDataSource(profile, html_source); | 683 ChromeURLDataManager::AddDataSource(profile, html_source); |
| 685 } | 684 } |
| 686 | 685 |
| 687 } // namespace chromeos | 686 } // namespace chromeos |
| OLD | NEW |