Commit 05df6652 authored by Steven Bennetts's avatar Steven Bennetts Committed by Commit Bot

Network Config: Deprecate SIM unlock dialog

SIM unlock is now integrated with the internet details dialog.

Bug: 777778
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I1509aea8356b86c8b887f398f58447c67964efcb

For misc. code removal owners:
TBR=jamescook@chromium.org,sky@chromium.org

Change-Id: I1509aea8356b86c8b887f398f58447c67964efcb
Reviewed-on: https://chromium-review.googlesource.com/738854
Commit-Queue: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarBen Chan <benchan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512869}
parent d4b8905f
...@@ -32,11 +32,6 @@ bool NetworkConnectDelegateMus::ShowEnrollNetwork( ...@@ -32,11 +32,6 @@ bool NetworkConnectDelegateMus::ShowEnrollNetwork(
return false; return false;
} }
void NetworkConnectDelegateMus::ShowMobileSimDialog() {
// TODO(mash): http://crbug.com/644355
NOTIMPLEMENTED();
}
void NetworkConnectDelegateMus::ShowMobileSetupDialog( void NetworkConnectDelegateMus::ShowMobileSetupDialog(
const std::string& network_id) { const std::string& network_id) {
// TODO(mash): http://crbug.com/644355 // TODO(mash): http://crbug.com/644355
......
...@@ -24,7 +24,6 @@ class NetworkConnectDelegateMus : public chromeos::NetworkConnect::Delegate { ...@@ -24,7 +24,6 @@ class NetworkConnectDelegateMus : public chromeos::NetworkConnect::Delegate {
void ShowNetworkConfigure(const std::string& network_id) override; void ShowNetworkConfigure(const std::string& network_id) override;
void ShowNetworkSettings(const std::string& network_id) override; void ShowNetworkSettings(const std::string& network_id) override;
bool ShowEnrollNetwork(const std::string& network_id) override; bool ShowEnrollNetwork(const std::string& network_id) override;
void ShowMobileSimDialog() override;
void ShowMobileSetupDialog(const std::string& network_id) override; void ShowMobileSetupDialog(const std::string& network_id) override;
void ShowNetworkConnectError(const std::string& error_name, void ShowNetworkConnectError(const std::string& error_name,
const std::string& network_id) override; const std::string& network_id) override;
......
...@@ -2649,74 +2649,6 @@ Press any key to continue exploring. ...@@ -2649,74 +2649,6 @@ Press any key to continue exploring.
No networks found. No networks found.
</message> </message>
<!-- SIM unlock -->
<message name="IDS_SIM_UNLOCK_CHANGE_PIN_TITLE" desc="Cellular device change PIN dialog title in chrome:settings/internet.">
Change SIM card PIN
</message>
<message name="IDS_SIM_UNLOCK_CHANGE_PIN_MESSAGE" desc="Cellular device change PIN dialog message in chrome:settings/internet.">
Please enter old and new PIN.
</message>
<message name="IDS_SIM_UNLOCK_CHANGE_PIN_OLD_PIN" desc="Cellular device change PIN dialog old PIN label text in chrome:settings/internet.">
Old PIN:
</message>
<message name="IDS_SIM_UNLOCK_CHANGE_PIN_NEW_PIN" desc="Cellular device change PIN dialog new PIN label text in chrome:settings/internet.">
New PIN:
</message>
<message name="IDS_SIM_UNLOCK_CHANGE_PIN_RETYPE_PIN" desc="Cellular device change PIN dialog re-type new PIN label text in chrome:settings/internet.">
Re-type new PIN:
</message>
<message name="IDS_SIM_UNLOCK_PINS_DONT_MATCH_ERROR" desc="Cellular device change PIN dialog message shown when entered new PINs don't match in chrome:settings/internet.">
PINs don't match!
</message>
<message name="IDS_SIM_UNLOCK_ENTER_PIN_TITLE" desc="Title of the SIM card unlock dialog in chrome:sim-unlock.">
Enter SIM card PIN
</message>
<message name="IDS_SIM_ENTER_PIN_MESSAGE" desc="Message on the the SIM card dialog asking to enter PIN in chrome:sim-unlock.">
Please enter PIN.
</message>
<message name="IDS_SIM_UNLOCK_ENTER_PIN_TRIES_MESSAGE" desc="Message on the the SIM card unlock dialog asking to enter PIN in chrome:sim-unlock.">
SIM card is locked, please enter PIN. Tries left: <ph name="TRIES_COUNT">$1<ex>42</ex></ph>
</message>
<message name="IDS_SIM_UNLOCK_INCORRECT_PIN_TRIES_MESSAGE" desc="Incorrect PIN message with the number of tries left shown on SIM card unlock dialog in chrome:sim-unlock.">
Incorrect PIN, please try again. Tries left: <ph name="TRIES_COUNT">$1<ex>42</ex></ph>
</message>
<message name="IDS_SIM_UNLOCK_INCORRECT_PIN_TITLE" desc="Title of the Incorrect PIN stage (no tries left) shown on SIM card unlock dialog in chrome:sim-unlock.">
Incorrect PIN
</message>
<message name="IDS_SIM_UNLOCK_NO_PIN_TRIES_LEFT_MESSAGE" desc="Message shown when there's no PIN tries left, shown on SIM card unlock dialog in chrome:sim-unlock.">
You have entered the incorrect PIN too many times. Please contact <ph name="CARRIER_ID">$1<ex>your carrier</ex></ph> to obtain a new 8-digit PIN Unlocking Key.
</message>
<message name="IDS_SIM_UNLOCK_DEFAULT_CARRIER" desc="Generic carrier name shown on SIM unlock dialog. Ex.: IDS_SIM_UNLOCK_NO_PIN_TRIES_LEFT_MESSAGE, IDS_SIM_UNLOCK_ENTER_PUK_MESSAGE">
your carrier
</message>
<message name="IDS_SIM_UNLOCK_ENTER_PUK_BUTTON" desc="Text of the button that will take to Enter PUK dialog, part of SIM card unlock dialog in chrome:sim-unlock.">
Enter PIN Unlocking Key
</message>
<message name="IDS_SIM_UNLOCK_ENTER_PUK_TITLE" desc="Title of the Enter PUK dialog, which is part of SIM card unlock dialog in chrome:sim-unlock.">
Enter PIN Unlocking Key
</message>
<message name="IDS_SIM_UNLOCK_ENTER_PUK_WARNING" desc="Warning on the Enter PUK dialog with the number of tries left, which is part of SIM card unlock dialog in chrome:sim-unlock.">
Your SIM card will be permanently disabled if you cannot enter the correct PIN Unlocking Key. Tries left: <ph name="TRIES_COUNT">$1<ex>42</ex></ph>
</message>
<message name="IDS_SIM_UNLOCK_ENTER_PUK_MESSAGE" desc="Message on the Enter PUK dialog, which is part of SIM card unlock dialog in chrome:sim-unlock.">
Please enter the 8-digit PIN Unlocking Key provided by <ph name="CARRIER_ID">$1<ex>your carrier</ex></ph>.
</message>
<message name="IDS_SIM_UNLOCK_CHOOSE_PIN_TITLE" desc="Title of the Choose new PIN dialog, which is part of SIM card unlock dialog in chrome:sim-unlock.">
Choose New PIN
</message>
<message name="IDS_SIM_UNLOCK_CHOOSE_PIN_MESSAGE" desc="Message on the Choose new PIN dialog, which is part of SIM card unlock dialog in chrome:sim-unlock.">
Please choose a new PIN.
</message>
<message name="IDS_SIM_UNLOCK_NO_PUK_TRIES_LEFT_MESSAGE" desc="Message shown when there're not PUK tries left, right after last try was used and SIM card is now disabled.">
You have entered the incorrect PIN Unlocking Key too many times. Your SIM card is permanently disabled.
</message>
<message name="IDS_SIM_UNLOCK_SIM_DISABLED_TITLE" desc="Title shown when there're not PUK tries left and SIM card is disabled.">
SIM card disabled
</message>
<message name="IDS_SIM_UNLOCK_SIM_DISABLED_MESSAGE" desc="Message shown when there're not PUK tries left and SIM card is disabled.">
This SIM card is disabled and cannot be used. Please contact your service provider for a replacement.
</message>
<!-- Slow UI --> <!-- Slow UI -->
<message name="IDS_SLOW_DISABLE" desc="The text of the button that disables performance collection for feedback reports"> <message name="IDS_SLOW_DISABLE" desc="The text of the button that disables performance collection for feedback reports">
Disable performance data collection Disable performance data collection
......
...@@ -466,7 +466,6 @@ ...@@ -466,7 +466,6 @@
<include name="IDR_BLUETOOTH_PAIR_DEVICE_HTML" file="resources\chromeos\bluetooth_pair_device.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_BLUETOOTH_PAIR_DEVICE_HTML" file="resources\chromeos\bluetooth_pair_device.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_BLUETOOTH_DIALOG_HOST_HTML" file="resources\chromeos\bluetooth_dialog_host.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" /> <include name="IDR_BLUETOOTH_DIALOG_HOST_HTML" file="resources\chromeos\bluetooth_dialog_host.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
<include name="IDR_BLUETOOTH_DIALOG_HOST_JS" file="resources\chromeos\bluetooth_dialog_host.js" type="chrome_html" /> <include name="IDR_BLUETOOTH_DIALOG_HOST_JS" file="resources\chromeos\bluetooth_dialog_host.js" type="chrome_html" />
<include name="IDR_SIM_UNLOCK_HTML" file="resources\chromeos\sim_unlock.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SLOW_HTML" file="resources\chromeos\slow.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_SLOW_HTML" file="resources\chromeos\slow.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SLOW_JS" file="resources\chromeos\slow.js" type="BINDATA" /> <include name="IDR_SLOW_JS" file="resources\chromeos\slow.js" type="BINDATA" />
<include name="IDR_HATS_HTML" file="resources\chromeos\hats\hats.html" flattenhtml="false" type="BINDATA" /> <include name="IDR_HATS_HTML" file="resources\chromeos\hats\hats.html" flattenhtml="false" type="BINDATA" />
......
...@@ -1455,8 +1455,6 @@ source_set("chromeos") { ...@@ -1455,8 +1455,6 @@ source_set("chromeos") {
"settings/system_settings_provider.h", "settings/system_settings_provider.h",
"settings/token_encryptor.cc", "settings/token_encryptor.cc",
"settings/token_encryptor.h", "settings/token_encryptor.h",
"sim_dialog_delegate.cc",
"sim_dialog_delegate.h",
"status/data_promo_notification.cc", "status/data_promo_notification.cc",
"status/data_promo_notification.h", "status/data_promo_notification.h",
"status/network_menu.cc", "status/network_menu.cc",
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include "chrome/browser/chromeos/enrollment_dialog_view.h" #include "chrome/browser/chromeos/enrollment_dialog_view.h"
#include "chrome/browser/chromeos/login/lock/screen_locker.h" #include "chrome/browser/chromeos/login/lock/screen_locker.h"
#include "chrome/browser/chromeos/net/network_state_notifier.h" #include "chrome/browser/chromeos/net/network_state_notifier.h"
#include "chrome/browser/chromeos/sim_dialog_delegate.h"
#include "chrome/browser/ui/ash/system_tray_client.h" #include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
...@@ -50,13 +49,6 @@ bool NetworkConnectDelegateChromeOS::ShowEnrollNetwork( ...@@ -50,13 +49,6 @@ bool NetworkConnectDelegateChromeOS::ShowEnrollNetwork(
nullptr /* owning_window */); nullptr /* owning_window */);
} }
void NetworkConnectDelegateChromeOS::ShowMobileSimDialog() {
if (!IsUIAvailable())
return;
SimDialogDelegate::ShowDialog(nullptr /* owning_window */,
SimDialogDelegate::SIM_DIALOG_UNLOCK);
}
void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog( void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog(
const std::string& network_id) { const std::string& network_id) {
if (!IsUIAvailable()) if (!IsUIAvailable())
......
...@@ -23,7 +23,6 @@ class NetworkConnectDelegateChromeOS : public NetworkConnect::Delegate { ...@@ -23,7 +23,6 @@ class NetworkConnectDelegateChromeOS : public NetworkConnect::Delegate {
void ShowNetworkConfigure(const std::string& network_id) override; void ShowNetworkConfigure(const std::string& network_id) override;
void ShowNetworkSettings(const std::string& network_id) override; void ShowNetworkSettings(const std::string& network_id) override;
bool ShowEnrollNetwork(const std::string& network_id) override; bool ShowEnrollNetwork(const std::string& network_id) override;
void ShowMobileSimDialog() override;
void ShowMobileSetupDialog(const std::string& service_path) override; void ShowMobileSetupDialog(const std::string& service_path) override;
void ShowNetworkConnectError(const std::string& error_name, void ShowNetworkConnectError(const std::string& error_name,
const std::string& network_id) override; const std::string& network_id) override;
......
...@@ -42,7 +42,6 @@ class NetworkConnectTestDelegate : public NetworkConnect::Delegate { ...@@ -42,7 +42,6 @@ class NetworkConnectTestDelegate : public NetworkConnect::Delegate {
bool ShowEnrollNetwork(const std::string& network_id) override { bool ShowEnrollNetwork(const std::string& network_id) override {
return false; return false;
} }
void ShowMobileSimDialog() override {}
void ShowMobileSetupDialog(const std::string& service_path) override {} void ShowMobileSetupDialog(const std::string& service_path) override {}
void ShowNetworkConnectError(const std::string& error_name, void ShowNetworkConnectError(const std::string& error_name,
const std::string& network_id) override { const std::string& network_id) override {
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/sim_dialog_delegate.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/system_tray_client.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/url_constants.h"
#include "ui/gfx/geometry/size.h"
using content::WebContents;
using content::WebUIMessageHandler;
namespace {
// Default width/height of the dialog.
const int kDefaultWidth = 350;
const int kDefaultHeight = 225;
// Width/height for the change PIN dialog mode.
const int kChangePinWidth = 350;
const int kChangePinHeight = 245;
// Dialog mode constants.
const char kSimDialogChangePinMode[] = "change-pin";
const char kSimDialogSetLockOnMode[] = "set-lock-on";
const char kSimDialogSetLockOffMode[] = "set-lock-off";
} // namespace
namespace chromeos {
// static
void SimDialogDelegate::ShowDialog(gfx::NativeWindow owning_window,
SimDialogMode mode) {
Profile* profile = ProfileManager::GetActiveUserProfile();
if (owning_window) {
chrome::ShowWebDialog(owning_window, profile, new SimDialogDelegate(mode));
} else {
chrome::ShowWebDialogInContainer(
SystemTrayClient::GetDialogParentContainerId(), profile,
new SimDialogDelegate(mode));
}
}
SimDialogDelegate::SimDialogDelegate(SimDialogMode dialog_mode)
: dialog_mode_(dialog_mode) {
}
SimDialogDelegate::~SimDialogDelegate() {
}
ui::ModalType SimDialogDelegate::GetDialogModalType() const {
return ui::MODAL_TYPE_SYSTEM;
}
base::string16 SimDialogDelegate::GetDialogTitle() const {
return base::string16();
}
GURL SimDialogDelegate::GetDialogContentURL() const {
if (dialog_mode_ == SIM_DIALOG_UNLOCK) {
std::string url_string(chrome::kChromeUISimUnlockURL);
return GURL(url_string);
} else {
std::string mode_value;
if (dialog_mode_ == SIM_DIALOG_CHANGE_PIN)
mode_value = kSimDialogChangePinMode;
else if (dialog_mode_ == SIM_DIALOG_SET_LOCK_ON)
mode_value = kSimDialogSetLockOnMode;
else
mode_value = kSimDialogSetLockOffMode;
// Create a URL that includes an additional mode (other than Unlock flow).
// Possible values for mode are:
// change-pin - use dialog to change PIN, ask for old & new PIN.
// set-lock-on - enable RequirePin restriction.
// set-lock-off - disable RequirePin restriction.
std::string url_string =
std::string(chrome::kChromeUISimUnlockURL) + "?mode=" + mode_value;
return GURL(url_string);
}
}
void SimDialogDelegate::GetWebUIMessageHandlers(
std::vector<WebUIMessageHandler*>* handlers) const {
}
void SimDialogDelegate::GetDialogSize(gfx::Size* size) const {
// TODO(nkostylev): Set custom size based on locale settings.
if (dialog_mode_ == SIM_DIALOG_CHANGE_PIN)
size->SetSize(kChangePinWidth , kChangePinHeight);
else
size->SetSize(kDefaultWidth, kDefaultHeight);
}
std::string SimDialogDelegate::GetDialogArgs() const {
return "[]";
}
void SimDialogDelegate::OnDialogClosed(const std::string& json_retval) {
delete this;
}
void SimDialogDelegate::OnCloseContents(WebContents* source,
bool* out_close_dialog) {
*out_close_dialog = true;
}
bool SimDialogDelegate::ShouldShowDialogTitle() const {
return false;
}
bool SimDialogDelegate::HandleContextMenu(
const content::ContextMenuParams& params) {
// Disable context menu.
return true;
}
} // namespace chromeos
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_
#define CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_
#include "base/macros.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/web_dialogs/web_dialog_delegate.h"
namespace chromeos {
// SIM unlock dialog displayed in cases when SIM card has to be unlocked.
class SimDialogDelegate : public ui::WebDialogDelegate {
public:
// Type of the SIM dialog that is launched.
typedef enum SimDialogMode {
SIM_DIALOG_UNLOCK = 0, // General unlock flow dialog (PIN/PUK).
SIM_DIALOG_CHANGE_PIN = 1, // Change PIN dialog.
SIM_DIALOG_SET_LOCK_ON = 2, // Enable RequirePin restriction.
SIM_DIALOG_SET_LOCK_OFF = 3, // Disable RequirePin restriction.
} SimDialogMode;
explicit SimDialogDelegate(SimDialogMode dialog_mode);
// Shows the SIM unlock dialog box with one of the specified modes. If the
// |owning_window| is null the dialog is placed in the appropriate modal
// dialog container on the primary display.
static void ShowDialog(gfx::NativeWindow owning_window, SimDialogMode mode);
private:
~SimDialogDelegate() override;
// Overridden from ui::WebDialogDelegate:
ui::ModalType GetDialogModalType() const override;
base::string16 GetDialogTitle() const override;
GURL GetDialogContentURL() const override;
void GetWebUIMessageHandlers(
std::vector<content::WebUIMessageHandler*>* handlers) const override;
void GetDialogSize(gfx::Size* size) const override;
std::string GetDialogArgs() const override;
void OnDialogClosed(const std::string& json_retval) override;
void OnCloseContents(content::WebContents* source,
bool* out_close_dialog) override;
bool ShouldShowDialogTitle() const override;
bool HandleContextMenu(const content::ContextMenuParams& params) override;
SimDialogMode dialog_mode_;
DISALLOW_COPY_AND_ASSIGN(SimDialogDelegate);
};
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_SIM_DIALOG_DELEGATE_H_
...@@ -42,7 +42,6 @@ class NetworkConnectTestDelegate : public chromeos::NetworkConnect::Delegate { ...@@ -42,7 +42,6 @@ class NetworkConnectTestDelegate : public chromeos::NetworkConnect::Delegate {
bool ShowEnrollNetwork(const std::string& network_id) override { bool ShowEnrollNetwork(const std::string& network_id) override {
return false; return false;
} }
void ShowMobileSimDialog() override {}
void ShowMobileSetupDialog(const std::string& network_id) override {} void ShowMobileSetupDialog(const std::string& network_id) override {}
void ShowNetworkConnectError(const std::string& error_name, void ShowNetworkConnectError(const std::string& error_name,
const std::string& network_id) override {} const std::string& network_id) override {}
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "chrome/browser/chromeos/mobile_config.h" #include "chrome/browser/chromeos/mobile_config.h"
#include "chrome/browser/chromeos/options/network_config_view.h" #include "chrome/browser/chromeos/options/network_config_view.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/sim_dialog_delegate.h"
#include "chrome/browser/defaults.h" #include "chrome/browser/defaults.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h" #include "chrome/browser/ui/webui/chromeos/internet_detail_dialog.h"
......
/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */
.error {
color: red;
}
#pin-error-msg {
height: 25px;
margin: 5px auto 5px auto;
}
.content-area {
max-height: 125px;
overflow: auto;
}
.change-pin-content-area {
height: 156px;
overflow: auto;
padding: 10px 15px 5px 15px;
width: 320px;
}
.choose-pin-content-area {
max-height: 125px;
min-height: 120px;
overflow: auto;
padding: 10px 15px 5px 15px;
width: 320px;
}
.input-area {
margin: 10px auto 25px auto;
width: 125px;
}
#pin-input-area {
margin-top: 30px;
}
#puk-input-area {
margin-bottom: 0;
}
#puk-content-area {
max-height: 163px;
}
.code-input {
border: 1px solid #aaa;
border-radius: 2px;
font-size: inherit;
padding: 3px;
}
#locked-puk-action-area {
-webkit-box-pack: center;
}
#disabled-sim-action-area {
-webkit-box-pack: center;
}
#puk-warning-msg {
padding-bottom: 6px;
}
#puk-enter-msg {
padding-top: 6px;
}
#choose-pin-msg {
padding-bottom: 6px;
}
#choose-pin-error {
padding-top: 6px;
}
.label {
margin: 5px 5px 5px 0;
padding: 5px 5px 5px 0;
width: 150px;
}
.input-with-label {
display: -webkit-box;
}
.choose-pin-input-area {
margin: 5px 5px 5px 5px;
width: 125px;
}
#choose-pin-action-area {
padding: 6px;
}
<!doctype html>
<html i18n-values="dir:textdirection;lang:language">
<head>
<meta charset="utf-8">
<title i18n-content="title"></title>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="chrome://resources/css/widgets.css">
<link rel="stylesheet" href="mobile_dialogs.css">
<link rel="stylesheet" href="sim_unlock.css">
<script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/cr/event_target.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="sim_unlock.js"></script>
<script>
var SimUnlock = mobile.SimUnlock;
function load() {
SimUnlock.initialize();
}
document.addEventListener('DOMContentLoaded', load);
</script>
</head>
<body>
<div id="container" class="container">
<div id="locked-pin-overlay" class="dialog" hidden>
<h1 i18n-content="enterPinTitle"></h1>
<div id="pin-content-area" class="content-area">
<div id="pin-error-msg"></div>
<div id="pin-input-area" class="input-area">
<input id="pin-input" class="code-input" type="password"
maxlength="8" size="14">
</div>
</div>
<div class="action-area">
<div class="action-area-right">
<div class="button-strip">
<button id="enter-pin-confirm" i18n-content="ok"></button>
<button id="enter-pin-dismiss" i18n-content="cancel"></button>
</div>
</div>
</div>
</div>
<div id="locked-pin-no-tries-overlay" class="dialog" hidden>
<h1 i18n-content="incorrectPinTitle"></h1>
<div id="pin-no-tries-content-area" class="content-area">
<!-- TODO(nkostylev): Add warning icon. -->
<div id="pin-no-tries-error-msg" i18n-content="noPinTriesLeft"></div>
</div>
<div class="action-area">
<div class="action-area-right">
<div class="button-strip">
<button id="pin-no-tries-proceed" i18n-content="enterPukButton">
</button>
<button id="pin-no-tries-dismiss" i18n-content="cancel"></button>
</div>
</div>
</div>
</div>
<div id="locked-puk-overlay" class="dialog" hidden>
<h1 i18n-content="enterPukTitle"></h1>
<div id="puk-content-area" class="content-area">
<div id="puk-warning-msg" i18n-content="enterPukWarning" class="error">
</div>
<div id="puk-enter-msg" i18n-content="enterPukMessage"></div>
<div id="puk-input-area" class="input-area">
<input id="puk-input" class="code-input" type="password"
maxlength="8" size="14">
</div>
</div>
<div class="action-area">
<div class="action-area-right">
<div class="button-strip">
<button id="enter-puk-confirm" i18n-content="ok"></button>
<button id="enter-puk-dismiss" i18n-content="cancel"></button>
</div>
</div>
</div>
</div>
<div id="choose-pin-overlay" class="dialog" hidden>
<h1 id="choose-pin-title" i18n-content="choosePinTitle"></h1>
<div id="choose-pin-content-area" class="choose-pin-content-area">
<div id="choose-pin-msg" i18n-content="choosePinMessage"></div>
<div class="input-with-label">
<div id="old-pin-label" i18n-content="oldPin" class="label" hidden>
</div>
<div id="old-pin-input-area" class="choose-pin-input-area" hidden>
<input id="old-pin-input" class="code-input" type="password"
maxlength="8" size="14">
</div>
</div>
<div class="input-with-label">
<div id="new-pin-label" i18n-content="newPin" class="label"></div>
<div id="new-pin-input-area" class="choose-pin-input-area">
<input id="new-pin-input" class="code-input" type="password"
maxlength="8" size="14">
</div>
</div>
<div class="input-with-label">
<div id="retype-new-pin-label" i18n-content="retypeNewPin"
class="label"></div>
<div id="retype-new-pin-input-area" class="choose-pin-input-area">
<input id="retype-new-pin-input" class="code-input" type="password"
maxlength="8" size="14">
</div>
</div>
<div id="choose-pin-error" class="error"
i18n-content="pinsDontMatchMessage" hidden></div>
</div>
<div id="choose-pin-action-area" class="action-area">
<div class="action-area-right">
<div class="button-strip">
<button id="choose-pin-confirm" i18n-content="ok"></button>
<button id="choose-pin-dismiss" i18n-content="cancel"></button>
</div>
</div>
</div>
</div>
<div id="locked-puk-no-tries-overlay" class="dialog" hidden>
<h1 i18n-content="enterPukTitle"></h1>
<div id="puk-no-tries-content-area" class="content-area">
<div id="puk-no-tries-msg" i18n-content="noPukTriesLeft"></div>
</div>
<div id="locked-puk-action-area" class="action-area">
<div class="button-strip">
<button id="puk-no-tries-confirm" i18n-content="ok"></button>
</div>
</div>
</div>
<div id="sim-disabled-overlay" class="dialog" hidden>
<h1 i18n-content="simDisabledTitle"></h1>
<div id="sim-disabled-content-area" class="content-area">
<div id="sim-disabled-msg" i18n-content="simDisabledMessage"></div>
</div>
<div id="disabled-sim-action-area" class="action-area">
<div class="button-strip">
<button id="sim-disabled-confirm" i18n-content="ok"></button>
</div>
</div>
</div>
</div>
</body>
</html>
This diff is collapsed.
...@@ -1436,8 +1436,6 @@ split_static_library("ui") { ...@@ -1436,8 +1436,6 @@ split_static_library("ui") {
"webui/chromeos/power_ui.h", "webui/chromeos/power_ui.h",
"webui/chromeos/set_time_ui.cc", "webui/chromeos/set_time_ui.cc",
"webui/chromeos/set_time_ui.h", "webui/chromeos/set_time_ui.h",
"webui/chromeos/sim_unlock_ui.cc",
"webui/chromeos/sim_unlock_ui.h",
"webui/chromeos/slow_trace_ui.cc", "webui/chromeos/slow_trace_ui.cc",
"webui/chromeos/slow_trace_ui.h", "webui/chromeos/slow_trace_ui.h",
"webui/chromeos/slow_ui.cc", "webui/chromeos/slow_ui.cc",
......
...@@ -146,7 +146,6 @@ ...@@ -146,7 +146,6 @@
#include "chrome/browser/ui/webui/chromeos/network_ui.h" #include "chrome/browser/ui/webui/chromeos/network_ui.h"
#include "chrome/browser/ui/webui/chromeos/power_ui.h" #include "chrome/browser/ui/webui/chromeos/power_ui.h"
#include "chrome/browser/ui/webui/chromeos/set_time_ui.h" #include "chrome/browser/ui/webui/chromeos/set_time_ui.h"
#include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h"
#include "chrome/browser/ui/webui/chromeos/slow_trace_ui.h" #include "chrome/browser/ui/webui/chromeos/slow_trace_ui.h"
#include "chrome/browser/ui/webui/chromeos/slow_ui.h" #include "chrome/browser/ui/webui/chromeos/slow_ui.h"
#include "chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_ui.h" #include "chrome/browser/ui/webui/chromeos/sys_internals/sys_internals_ui.h"
...@@ -464,8 +463,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -464,8 +463,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<chromeos::InternetDetailDialogUI>; return &NewWebUI<chromeos::InternetDetailDialogUI>;
if (url.host_piece() == chrome::kChromeUISetTimeHost) if (url.host_piece() == chrome::kChromeUISetTimeHost)
return &NewWebUI<chromeos::SetTimeUI>; return &NewWebUI<chromeos::SetTimeUI>;
if (url.host_piece() == chrome::kChromeUISimUnlockHost)
return &NewWebUI<chromeos::SimUnlockUI>;
if (url.host_piece() == chrome::kChromeUISlowHost) if (url.host_piece() == chrome::kChromeUISlowHost)
return &NewWebUI<chromeos::SlowUI>; return &NewWebUI<chromeos::SlowUI>;
if (url.host_piece() == chrome::kChromeUISlowTraceHost) if (url.host_piece() == chrome::kChromeUISlowTraceHost)
......
...@@ -6,7 +6,5 @@ xiyuan@chromium.org ...@@ -6,7 +6,5 @@ xiyuan@chromium.org
zelidrag@chromium.org zelidrag@chromium.org
per-file network*=stevenjb@chromium.org per-file network*=stevenjb@chromium.org
per-file sim_unlock_ui.*=armansito@chromium.org
per-file sim_unlock_ui.*=stevenjb@chromium.org
per-file drive_internals_ui.*=hashimoto@chromium.org per-file drive_internals_ui.*=hashimoto@chromium.org
per-file drive_internals_ui.*=kinaba@chromium.org per-file drive_internals_ui.*=kinaba@chromium.org
This diff is collapsed.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_SIM_UNLOCK_UI_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_SIM_UNLOCK_UI_H_
#include "base/macros.h"
#include "content/public/browser/web_ui_controller.h"
namespace chromeos {
// A custom WebUI that defines datasource for SIM unlock dialog that is used
// in Chrome OS for specific tasks:
// - Unlock SIM card (enter PIN/PUK codes).
// - Display "SIM card is blocked" message when there're no PUK tries left.
class SimUnlockUI : public content::WebUIController {
public:
explicit SimUnlockUI(content::WebUI* web_ui);
private:
DISALLOW_COPY_AND_ASSIGN(SimUnlockUI);
};
} // namespace chromeos
#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_SIM_UNLOCK_UI_H_
...@@ -209,8 +209,6 @@ const char kChromeUIScreenlockIconHost[] = "screenlock-icon"; ...@@ -209,8 +209,6 @@ const char kChromeUIScreenlockIconHost[] = "screenlock-icon";
const char kChromeUIScreenlockIconURL[] = "chrome://screenlock-icon/"; const char kChromeUIScreenlockIconURL[] = "chrome://screenlock-icon/";
const char kChromeUISetTimeHost[] = "set-time"; const char kChromeUISetTimeHost[] = "set-time";
const char kChromeUISetTimeURL[] = "chrome://set-time/"; const char kChromeUISetTimeURL[] = "chrome://set-time/";
const char kChromeUISimUnlockHost[] = "sim-unlock";
const char kChromeUISimUnlockURL[] = "chrome://sim-unlock/";
const char kChromeUISlowHost[] = "slow"; const char kChromeUISlowHost[] = "slow";
const char kChromeUISlowTraceHost[] = "slow_trace"; const char kChromeUISlowTraceHost[] = "slow_trace";
const char kChromeUISlowURL[] = "chrome://slow/"; const char kChromeUISlowURL[] = "chrome://slow/";
......
...@@ -206,8 +206,6 @@ extern const char kChromeUIScreenlockIconHost[]; ...@@ -206,8 +206,6 @@ extern const char kChromeUIScreenlockIconHost[];
extern const char kChromeUIScreenlockIconURL[]; extern const char kChromeUIScreenlockIconURL[];
extern const char kChromeUISetTimeHost[]; extern const char kChromeUISetTimeHost[];
extern const char kChromeUISetTimeURL[]; extern const char kChromeUISetTimeURL[];
extern const char kChromeUISimUnlockHost[];
extern const char kChromeUISimUnlockURL[];
extern const char kChromeUISlowHost[]; extern const char kChromeUISlowHost[];
extern const char kChromeUISlowTraceHost[]; extern const char kChromeUISlowTraceHost[];
extern const char kChromeUISlowURL[]; extern const char kChromeUISlowURL[];
......
...@@ -454,10 +454,11 @@ void NetworkConnectImpl::SetTechnologyEnabled( ...@@ -454,10 +454,11 @@ void NetworkConnectImpl::SetTechnologyEnabled(
NET_LOG_USER("Cannot enable cellular device without SIM.", log_string); NET_LOG_USER("Cannot enable cellular device without SIM.", log_string);
return; return;
} }
if (!mobile->sim_lock_type().empty()) { if (!mobile->IsSimLocked()) {
// A SIM has been inserted, but it is locked. Let the user unlock it // A SIM has been inserted, but it is locked. Let the user unlock it
// via the dialog. // via Settings or the details dialog.
delegate_->ShowMobileSimDialog(); const NetworkState* network = handler->FirstNetworkByType(technology);
delegate_->ShowNetworkSettings(network ? network->guid() : "");
return; return;
} }
} }
......
...@@ -38,9 +38,6 @@ class CHROMEOS_EXPORT NetworkConnect { ...@@ -38,9 +38,6 @@ class CHROMEOS_EXPORT NetworkConnect {
// and returns true, otherwise returns false. // and returns true, otherwise returns false.
virtual bool ShowEnrollNetwork(const std::string& network_id) = 0; virtual bool ShowEnrollNetwork(const std::string& network_id) = 0;
// Shows UI to unlock a mobile sim.
virtual void ShowMobileSimDialog() = 0;
// Shows UI to setup a mobile network. // Shows UI to setup a mobile network.
virtual void ShowMobileSetupDialog(const std::string& network_id) = 0; virtual void ShowMobileSetupDialog(const std::string& network_id) = 0;
......
...@@ -50,7 +50,6 @@ class MockDelegate : public NetworkConnect::Delegate { ...@@ -50,7 +50,6 @@ class MockDelegate : public NetworkConnect::Delegate {
MOCK_METHOD1(ShowNetworkConfigure, void(const std::string& network_id)); MOCK_METHOD1(ShowNetworkConfigure, void(const std::string& network_id));
MOCK_METHOD1(ShowNetworkSettings, void(const std::string& network_id)); MOCK_METHOD1(ShowNetworkSettings, void(const std::string& network_id));
MOCK_METHOD1(ShowEnrollNetwork, bool(const std::string& network_id)); MOCK_METHOD1(ShowEnrollNetwork, bool(const std::string& network_id));
MOCK_METHOD0(ShowMobileSimDialog, void());
MOCK_METHOD1(ShowMobileSetupDialog, void(const std::string& network_id)); MOCK_METHOD1(ShowMobileSetupDialog, void(const std::string& network_id));
MOCK_METHOD2(ShowNetworkConnectError, MOCK_METHOD2(ShowNetworkConnectError,
void(const std::string& error_name, void(const std::string& error_name,
...@@ -350,52 +349,4 @@ TEST_F(NetworkConnectTest, ActivateCellular_Error) { ...@@ -350,52 +349,4 @@ TEST_F(NetworkConnectTest, ActivateCellular_Error) {
NetworkConnect::Get()->ConnectToNetworkId(kCellular1Guid); NetworkConnect::Get()->ConnectToNetworkId(kCellular1Guid);
} }
TEST_F(NetworkConnectTest, ShowMobileSimDialog) {
EXPECT_CALL(*mock_delegate_, ShowMobileSimDialog());
NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
false);
device_test_->SetDeviceProperty(
kCellular1DevicePath, shill::kSIMPresentProperty, base::Value(true));
device_test_->SetSimLocked(kCellular1DevicePath, true);
base::RunLoop().RunUntilIdle();
NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
true);
}
TEST_F(NetworkConnectTest, ShowMobileSimDialog_SimAbsent) {
EXPECT_CALL(*mock_delegate_, ShowMobileSimDialog()).Times(0);
NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
false);
device_test_->SetDeviceProperty(
kCellular1DevicePath, shill::kSIMPresentProperty, base::Value(false));
device_test_->SetSimLocked(kCellular1DevicePath, true);
base::RunLoop().RunUntilIdle();
NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
true);
}
TEST_F(NetworkConnectTest, ShowMobileSimDialog_SimUnlocked) {
EXPECT_CALL(*mock_delegate_, ShowMobileSimDialog()).Times(0);
NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
false);
device_test_->SetDeviceProperty(
kCellular1DevicePath, shill::kSIMPresentProperty, base::Value(true));
device_test_->SetSimLocked(kCellular1DevicePath, false);
base::RunLoop().RunUntilIdle();
NetworkConnect::Get()->SetTechnologyEnabled(NetworkTypePattern::Cellular(),
true);
}
} // namespace chromeos } // namespace chromeos
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment