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/mobile_setup_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 l10n_util::GetStringUTF16(IDS_MOBILE_INVALID_DEVICE_INFO_HEADER)); | 331 l10n_util::GetStringUTF16(IDS_MOBILE_INVALID_DEVICE_INFO_HEADER)); |
332 strings.SetString("title", l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE)); | 332 strings.SetString("title", l10n_util::GetStringUTF16(IDS_MOBILE_SETUP_TITLE)); |
333 strings.SetString("close_button", | 333 strings.SetString("close_button", |
334 l10n_util::GetStringUTF16(IDS_CLOSE)); | 334 l10n_util::GetStringUTF16(IDS_CLOSE)); |
335 strings.SetString("cancel_button", | 335 strings.SetString("cancel_button", |
336 l10n_util::GetStringUTF16(IDS_CANCEL)); | 336 l10n_util::GetStringUTF16(IDS_CANCEL)); |
337 strings.SetString("ok_button", | 337 strings.SetString("ok_button", |
338 l10n_util::GetStringUTF16(IDS_OK)); | 338 l10n_util::GetStringUTF16(IDS_OK)); |
339 webui::SetFontAndTextDirection(&strings); | 339 webui::SetFontAndTextDirection(&strings); |
340 | 340 |
| 341 webui::UseVersion2 version_2; |
| 342 |
341 // The webui differs based on whether the network is activated or not. If the | 343 // The webui differs based on whether the network is activated or not. If the |
342 // network is activated, the webui goes straight to portal. Otherwise the | 344 // network is activated, the webui goes straight to portal. Otherwise the |
343 // webui is used for activation flow. | 345 // webui is used for activation flow. |
344 std::string full_html; | 346 std::string full_html; |
345 if (activation_state == shill::kActivationStateActivated) { | 347 if (activation_state == shill::kActivationStateActivated) { |
346 static const base::StringPiece html_for_activated( | 348 static const base::StringPiece html_for_activated( |
347 ResourceBundle::GetSharedInstance().GetRawDataResource( | 349 ResourceBundle::GetSharedInstance().GetRawDataResource( |
348 IDR_MOBILE_SETUP_PORTAL_PAGE_HTML)); | 350 IDR_MOBILE_SETUP_PORTAL_PAGE_HTML)); |
349 full_html = webui::GetI18nTemplateHtml(html_for_activated, &strings); | 351 full_html = webui::GetI18nTemplateHtml(html_for_activated, &strings); |
350 } else { | 352 } else { |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 const GURL& validated_url, | 652 const GURL& validated_url, |
651 int error_code, | 653 int error_code, |
652 const base::string16& error_description) { | 654 const base::string16& error_description) { |
653 if (render_frame_host->GetFrameName() != "paymentForm") | 655 if (render_frame_host->GetFrameName() != "paymentForm") |
654 return; | 656 return; |
655 | 657 |
656 base::FundamentalValue result_value(-error_code); | 658 base::FundamentalValue result_value(-error_code); |
657 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback, | 659 web_ui()->CallJavascriptFunction(kJsPortalFrameLoadFailedCallback, |
658 result_value); | 660 result_value); |
659 } | 661 } |
OLD | NEW |