Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: chrome/browser/resources/mobile_setup.js

Issue 8271025: Moved mobile activation into its own modal dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/mobile_setup.html ('k') | chrome/browser/resources/shared/css/dialogs.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/mobile_setup.js
===================================================================
--- chrome/browser/resources/mobile_setup.js (revision 106917)
+++ chrome/browser/resources/mobile_setup.js (working copy)
@@ -57,13 +57,33 @@
this.initialized_ = true;
self = this;
this.frameName_ = frame_name;
+
+ cr.ui.dialogs.BaseDialog.OK_LABEL =
+ MobileSetup.localStrings_.getString('ok_button');
+ cr.ui.dialogs.BaseDialog.CANCEL_LABEL =
+ MobileSetup.localStrings_.getString('cancel_button');
+ this.confirm_ = new cr.ui.dialogs.ConfirmDialog(document.body);
+
window.addEventListener('message', function(e) {
self.onMessageReceived_(e);
});
+
$('closeButton').addEventListener('click', function(e) {
- $('finalStatus').classList.add('hidden');
+ $('finalStatus').classList.add('hidden');
});
+ $('cancelButton').addEventListener('click', function(e) {
+ if (self.state_ == MobileSetup.PLAN_ACTIVATION_DONE ||
+ self.state_ == MobileSetup.PLAN_ACTIVATION_ERROR) {
+ window.close();
+ return;
+ }
+ self.confirm_.show(
+ MobileSetup.localStrings_.getString('cancel_question'), function() {
+ window.close();
+ });
+ });
+
this.changeState_({state: MobileSetup.PLAN_ACTIVATION_PAGE_LOADING});
setInterval(mobile.MobileSetup.drawProgress, 100);
// Kick off activation process.
@@ -181,10 +201,13 @@
$('paymentForm').classList.remove('hidden');
$('closeButton').classList.remove('hidden');
$('finalStatus').classList.remove('hidden');
- if (this.payment_shown_)
+ if (this.payment_shown_) {
$('closeButton').classList.remove('hidden');
- else
+ } else {
$('closeButton').classList.add('hidden');
+ $('cancelButton').textContent =
+ MobileSetup.localStrings_.getString('close_button');
+ }
break;
case MobileSetup.PLAN_ACTIVATION_ERROR:
$('statusHeader').textContent = '';
@@ -196,10 +219,13 @@
$('canvas').classList.add('hidden');
$('carrierPage').classList.add('hidden');
$('paymentForm').classList.remove('hidden');
- if (this.payment_shown_)
+ if (this.payment_shown_) {
$('closeButton').classList.remove('hidden');
- else
+ } else {
$('closeButton').classList.add('hidden');
+ $('cancelButton').textContent =
+ MobileSetup.localStrings_.getString('close_button');
+ }
$('finalStatus').classList.remove('hidden');
break;
}
« no previous file with comments | « chrome/browser/resources/mobile_setup.html ('k') | chrome/browser/resources/shared/css/dialogs.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698