| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 strings.SetString("please_wait", | 471 strings.SetString("please_wait", |
| 472 l10n_util::GetStringUTF16(IDS_MOBILE_PLEASE_WAIT)); | 472 l10n_util::GetStringUTF16(IDS_MOBILE_PLEASE_WAIT)); |
| 473 strings.SetString("completed_text", | 473 strings.SetString("completed_text", |
| 474 l10n_util::GetStringUTF16(IDS_MOBILE_COMPLETED_TEXT)); | 474 l10n_util::GetStringUTF16(IDS_MOBILE_COMPLETED_TEXT)); |
| 475 strings.SetString("close_button", | 475 strings.SetString("close_button", |
| 476 l10n_util::GetStringUTF16(IDS_CLOSE)); | 476 l10n_util::GetStringUTF16(IDS_CLOSE)); |
| 477 strings.SetString("cancel_button", | 477 strings.SetString("cancel_button", |
| 478 l10n_util::GetStringUTF16(IDS_CANCEL)); | 478 l10n_util::GetStringUTF16(IDS_CANCEL)); |
| 479 strings.SetString("ok_button", | 479 strings.SetString("ok_button", |
| 480 l10n_util::GetStringUTF16(IDS_OK)); | 480 l10n_util::GetStringUTF16(IDS_OK)); |
| 481 strings.SetString("cancel_question", | |
| 482 l10n_util::GetStringUTF16(IDS_MOBILE_CANCEL_ACTIVATION)); | |
| 483 SetFontAndTextDirection(&strings); | 481 SetFontAndTextDirection(&strings); |
| 484 | 482 |
| 485 static const base::StringPiece html( | 483 static const base::StringPiece html( |
| 486 ResourceBundle::GetSharedInstance().GetRawDataResource( | 484 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 487 IDR_MOBILE_SETUP_PAGE_HTML, ui::SCALE_FACTOR_NONE)); | 485 IDR_MOBILE_SETUP_PAGE_HTML, ui::SCALE_FACTOR_NONE)); |
| 488 | 486 |
| 489 std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html, | 487 std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html, |
| 490 &strings); | 488 &strings); |
| 491 | 489 |
| 492 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); | 490 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 << network->service_path().c_str(); | 870 << network->service_path().c_str(); |
| 873 break; | 871 break; |
| 874 } | 872 } |
| 875 } | 873 } |
| 876 break; | 874 break; |
| 877 } | 875 } |
| 878 case PLAN_ACTIVATION_DELAY_OTASP: | 876 case PLAN_ACTIVATION_DELAY_OTASP: |
| 879 // Just ignore any changes until the OTASP retry timer kicks in. | 877 // Just ignore any changes until the OTASP retry timer kicks in. |
| 880 evaluating_ = false; | 878 evaluating_ = false; |
| 881 return; | 879 return; |
| 882 case PLAN_ACTIVATION_INITIATING_ACTIVATION: | 880 case PLAN_ACTIVATION_INITIATING_ACTIVATION: { |
| 881 switch (network->activation_state()) { |
| 882 case chromeos::ACTIVATION_STATE_ACTIVATED: |
| 883 case chromeos::ACTIVATION_STATE_PARTIALLY_ACTIVATED: |
| 884 new_state = PLAN_ACTIVATION_START; |
| 885 break; |
| 886 case chromeos::ACTIVATION_STATE_NOT_ACTIVATED: |
| 887 case chromeos::ACTIVATION_STATE_ACTIVATING: |
| 888 // Wait in this state until activation state changes. |
| 889 break; |
| 890 default: |
| 891 break; |
| 892 } |
| 893 break; |
| 894 } |
| 883 case PLAN_ACTIVATION_OTASP: | 895 case PLAN_ACTIVATION_OTASP: |
| 884 case PLAN_ACTIVATION_TRYING_OTASP: { | 896 case PLAN_ACTIVATION_TRYING_OTASP: { |
| 885 switch (network->activation_state()) { | 897 switch (network->activation_state()) { |
| 886 case chromeos::ACTIVATION_STATE_ACTIVATED: | 898 case chromeos::ACTIVATION_STATE_ACTIVATED: |
| 887 if (network->disconnected()) { | 899 if (network->disconnected()) { |
| 888 new_state = GetNextReconnectState(state_); | 900 new_state = GetNextReconnectState(state_); |
| 889 } else if (network->connected()) { | 901 } else if (network->connected()) { |
| 890 if (network->restricted_pool()) { | 902 if (network->restricted_pool()) { |
| 891 new_state = PLAN_ACTIVATION_PAYMENT_PORTAL_LOADING; | 903 new_state = PLAN_ACTIVATION_PAYMENT_PORTAL_LOADING; |
| 892 } else { | 904 } else { |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1404 | 1416 |
| 1405 // Set up the chrome://mobilesetup/ source. | 1417 // Set up the chrome://mobilesetup/ source. |
| 1406 Profile* profile = Profile::FromWebUI(web_ui); | 1418 Profile* profile = Profile::FromWebUI(web_ui); |
| 1407 ChromeURLDataManager::AddDataSource(profile, html_source); | 1419 ChromeURLDataManager::AddDataSource(profile, html_source); |
| 1408 } | 1420 } |
| 1409 | 1421 |
| 1410 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { | 1422 void MobileSetupUI::RenderViewCreated(RenderViewHost* host) { |
| 1411 // Destroyed by the corresponding RenderViewHost | 1423 // Destroyed by the corresponding RenderViewHost |
| 1412 new PortalFrameLoadObserver(AsWeakPtr(), host); | 1424 new PortalFrameLoadObserver(AsWeakPtr(), host); |
| 1413 } | 1425 } |
| OLD | NEW |