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/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_MESSAGE)); | 323 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_MESSAGE)); |
324 strings.SetString("oldPin", l10n_util::GetStringUTF16( | 324 strings.SetString("oldPin", l10n_util::GetStringUTF16( |
325 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_OLD_PIN)); | 325 IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_OLD_PIN)); |
326 | 326 |
327 webui::SetFontAndTextDirection(&strings); | 327 webui::SetFontAndTextDirection(&strings); |
328 | 328 |
329 static const base::StringPiece html( | 329 static const base::StringPiece html( |
330 ResourceBundle::GetSharedInstance().GetRawDataResource( | 330 ResourceBundle::GetSharedInstance().GetRawDataResource( |
331 IDR_SIM_UNLOCK_HTML)); | 331 IDR_SIM_UNLOCK_HTML)); |
332 | 332 |
333 webui::UseVersion2 version2; | |
334 std::string full_html = webui::GetI18nTemplateHtml(html, &strings); | 333 std::string full_html = webui::GetI18nTemplateHtml(html, &strings); |
335 | |
336 callback.Run(base::RefCountedString::TakeString(&full_html)); | 334 callback.Run(base::RefCountedString::TakeString(&full_html)); |
337 } | 335 } |
338 | 336 |
339 // SimUnlockHandler ------------------------------------------------------------ | 337 // SimUnlockHandler ------------------------------------------------------------ |
340 | 338 |
341 SimUnlockHandler::SimUnlockHandler() | 339 SimUnlockHandler::SimUnlockHandler() |
342 : state_(SIM_UNLOCK_LOADING), | 340 : state_(SIM_UNLOCK_LOADING), |
343 dialog_mode_(SimDialogDelegate::SIM_DIALOG_UNLOCK), | 341 dialog_mode_(SimDialogDelegate::SIM_DIALOG_UNLOCK), |
344 pending_pin_operation_(false), | 342 pending_pin_operation_(false), |
345 weak_ptr_factory_(this) { | 343 weak_ptr_factory_(this) { |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 SimUnlockHandler* handler = new SimUnlockHandler(); | 759 SimUnlockHandler* handler = new SimUnlockHandler(); |
762 web_ui->AddMessageHandler(handler); | 760 web_ui->AddMessageHandler(handler); |
763 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); | 761 SimUnlockUIHTMLSource* html_source = new SimUnlockUIHTMLSource(); |
764 | 762 |
765 // Set up the chrome://sim-unlock/ source. | 763 // Set up the chrome://sim-unlock/ source. |
766 Profile* profile = Profile::FromWebUI(web_ui); | 764 Profile* profile = Profile::FromWebUI(web_ui); |
767 content::URLDataSource::Add(profile, html_source); | 765 content::URLDataSource::Add(profile, html_source); |
768 } | 766 } |
769 | 767 |
770 } // namespace chromeos | 768 } // namespace chromeos |
OLD | NEW |