summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-20 12:44:46 +0000
committernkostylev@chromium.org <nkostylev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-20 12:44:46 +0000
commit04e1f9e21f634b53a7e934de2cfb221ee5034697 (patch)
treecccfae915e84b05feafd4d527dcd9bb8f6b3b0e6
parentbc36f2a13642d84acc1a71405f9a5fbb75c74cd5 (diff)
downloadchromium_src-04e1f9e21f634b53a7e934de2cfb221ee5034697.zip
chromium_src-04e1f9e21f634b53a7e934de2cfb221ee5034697.tar.gz
chromium_src-04e1f9e21f634b53a7e934de2cfb221ee5034697.tar.bz2
[cros] Several SIM dialog fixes.
* Hide "Old pin" input in SIM unblock case. * Launch SIM unblock flow when no PIN retries are left during changing PIN/PinRequire preference. * Some UI polishing of Change PIN UI. BUG=chromium-os:13702 TEST=Manual. Launched Change PIN/Lock on/off dialog, entered PIN incorrectly 3 times, observed PUK unblock dialog. Review URL: http://codereview.chromium.org/6877082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82283 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/sim_dialog_delegate.cc2
-rw-r--r--chrome/browser/resources/chromeos/sim_unlock.css16
-rw-r--r--chrome/browser/resources/chromeos/sim_unlock.html9
-rw-r--r--chrome/browser/resources/chromeos/sim_unlock.js7
-rw-r--r--chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc14
5 files changed, 33 insertions, 15 deletions
diff --git a/chrome/browser/chromeos/sim_dialog_delegate.cc b/chrome/browser/chromeos/sim_dialog_delegate.cc
index 3abcc20..f1ecaba 100644
--- a/chrome/browser/chromeos/sim_dialog_delegate.cc
+++ b/chrome/browser/chromeos/sim_dialog_delegate.cc
@@ -21,7 +21,7 @@ const int kDefaultHeight = 225;
// Width/height for the change PIN dialog mode.
const int kChangePinWidth = 350;
-const int kChangePinHeight = 256;
+const int kChangePinHeight = 245;
// URL that includes additional mode (other than Unlock flow) that we're using
// dialog for. Possible values:
diff --git a/chrome/browser/resources/chromeos/sim_unlock.css b/chrome/browser/resources/chromeos/sim_unlock.css
index 18d5fbe..e1ef353 100644
--- a/chrome/browser/resources/chromeos/sim_unlock.css
+++ b/chrome/browser/resources/chromeos/sim_unlock.css
@@ -13,8 +13,18 @@
}
.change-pin-content-area {
- max-height: 156px;
+ 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 {
@@ -71,10 +81,6 @@
display: -webkit-box;
}
-#choose-pin-content-area {
- min-height: 120px;
-}
-
.choose-pin-input-area {
margin: 5px 5px 5px 5px;
width: 125px;
diff --git a/chrome/browser/resources/chromeos/sim_unlock.html b/chrome/browser/resources/chromeos/sim_unlock.html
index caa11f8..808f1cac9 100644
--- a/chrome/browser/resources/chromeos/sim_unlock.html
+++ b/chrome/browser/resources/chromeos/sim_unlock.html
@@ -78,11 +78,12 @@ document.addEventListener('DOMContentLoaded', load);
</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="content-area">
+ <div id="choose-pin-content-area" class="choose-pin-content-area">
<div id="choose-pin-msg" i18n-content="choosePinMessage"></div>
- <div id="old-pin" class="input-with-label" hidden>
- <div id="old-pin-label" i18n-content="oldPin" class="label"></div>
- <div id="old-pin-input-area" class="choose-pin-input-area">
+ <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="text"
maxlength="8" size="14">
</div>
diff --git a/chrome/browser/resources/chromeos/sim_unlock.js b/chrome/browser/resources/chromeos/sim_unlock.js
index e0165c7..867aff7 100644
--- a/chrome/browser/resources/chromeos/sim_unlock.js
+++ b/chrome/browser/resources/chromeos/sim_unlock.js
@@ -251,20 +251,21 @@ cr.define('mobile', function() {
// Our dialog has different height than choose-pin step of the
// unlock process which we're reusing.
if (changePin) {
- $('choose-pin-content-area').classList.remove('content-area');
+ $('choose-pin-content-area').classList.remove('choose-pin-content-area');
$('choose-pin-content-area').classList.add('change-pin-content-area');
var title = SimUnlock.localStrings_.getString('changePinTitle');
$('choose-pin-title').textContent = title;
} else {
$('choose-pin-content-area').classList.remove('change-pin-content-area');
- $('choose-pin-content-area').classList.add('content-area');
+ $('choose-pin-content-area').classList.add('choose-pin-content-area');
var pinMessage = SimUnlock.localStrings_.getString('choosePinMessage');
$('choose-pin-msg').classList.remove('error');
$('choose-pin-msg').textContent = pinMessage;
var title = SimUnlock.localStrings_.getString('choosePinTitle');
$('choose-pin-title').textContent = title;
}
- $('old-pin').hidden = !changePin;
+ $('old-pin-label').hidden = !changePin;
+ $('old-pin-input-area').hidden = !changePin;
};
SimUnlock.newPinEntered = function(newPin, newPin2) {
diff --git a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
index 33088f2..b5f329e 100644
--- a/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
@@ -568,8 +568,17 @@ void SimUnlockHandler::ProcessSimCardState(
case SIM_NOT_LOCKED_ASK_PIN:
case SIM_NOT_LOCKED_CHANGE_PIN:
// We always start in these states when SIM is unlocked.
- // So if we get here, that means entered PIN was incorrect.
- error_msg = kErrorPin;
+ // So if we get here while still being UNLOCKED,
+ // that means entered PIN was incorrect.
+ if (lock_state == chromeos::SIM_UNLOCKED) {
+ error_msg = kErrorPin;
+ } else if (lock_state == chromeos::SIM_LOCKED_PUK) {
+ state_ = SIM_LOCKED_NO_PIN_TRIES_LEFT;
+ } else {
+ NOTREACHED()
+ << "Change PIN / Set lock mode with unexpected SIM lock state";
+ state_ = SIM_ABSENT_NOT_LOCKED;
+ }
break;
case SIM_LOCKED_PIN:
if (lock_state == chromeos::SIM_UNLOCKED ||
@@ -602,6 +611,7 @@ void SimUnlockHandler::ProcessSimCardState(
break;
}
} else {
+ VLOG(1) << "Cellular device is absent.";
// No cellular device, should close dialog.
state_ = SIM_ABSENT_NOT_LOCKED;
}