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

Unified Diff: chrome/browser/resources/extensions/chromeos/kiosk_app_disable_bailout_confirm.js

Issue 15966004: cros: Move kiosk settings to extensions page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and remove temp flag Created 7 years, 7 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
Index: chrome/browser/resources/extensions/chromeos/kiosk_app_disable_bailout_confirm.js
diff --git a/chrome/browser/resources/options/chromeos/kiosk_app_disable_bailout_confirm.js b/chrome/browser/resources/extensions/chromeos/kiosk_app_disable_bailout_confirm.js
similarity index 57%
rename from chrome/browser/resources/options/chromeos/kiosk_app_disable_bailout_confirm.js
rename to chrome/browser/resources/extensions/chromeos/kiosk_app_disable_bailout_confirm.js
index caa1ee3270428270624be6d1929d3d65f897d59c..19e4a67259d875b78f8a17bd15d8e560199aadd2 100644
--- a/chrome/browser/resources/options/chromeos/kiosk_app_disable_bailout_confirm.js
+++ b/chrome/browser/resources/extensions/chromeos/kiosk_app_disable_bailout_confirm.js
@@ -2,45 +2,38 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-cr.define('options', function() {
- /** @const */ var OptionsPage = options.OptionsPage;
-
+cr.define('extensions', function() {
/**
* A confirmation overlay for disabling kiosk app bailout shortcut.
- * @extends {options.OptionsPage}
* @constructor
*/
function KioskDisableBailoutConfirm() {
- OptionsPage.call(this,
- 'kioskDisableBailoutConfirm',
- '',
- 'kiosk-disable-bailout-confirm-overlay');
}
cr.addSingletonGetter(KioskDisableBailoutConfirm);
KioskDisableBailoutConfirm.prototype = {
- __proto__: OptionsPage.prototype,
-
- /** @override */
+ /**
+ * Initialize the page.
+ */
initializePage: function() {
Dan Beam 2013/05/30 21:14:55 nit: I would maybe consider renaming this to avoid
xiyuan 2013/05/30 23:03:38 Done.
- OptionsPage.prototype.initializePage.call(this);
+ var overlay = $('kiosk-disable-bailout-confirm-overlay');
+ cr.ui.overlay.setupOverlay(overlay);
+ overlay.addEventListener('cancelOverlay', this.handleCancel);
var el = $('kiosk-disable-bailout-shortcut');
- el.customChangeHandler = this.handleDisableBailoutShortcutChange_;
+ el.addEventListener('change', this.handleDisableBailoutShortcutChange_);
$('kiosk-disable-bailout-confirm-button').onclick = function(e) {
- OptionsPage.closeOverlay();
- Preferences.setBooleanPref(
- 'cros.accounts.deviceLocalAccountAutoLoginBailoutEnabled',
- false, true);
+ ExtensionSettings.showOverlay($('kiosk-apps-page'));
+ chrome.send('setDisableBailoutShortcut', [true]);
};
$('kiosk-disable-bailout-cancel-button').onclick = this.handleCancel;
},
- /** @override */
+ /** Handles overlay being canceled. */
handleCancel: function() {
- OptionsPage.closeOverlay();
+ ExtensionSettings.showOverlay($('kiosk-apps-page'));
$('kiosk-disable-bailout-shortcut').checked = false;
},
@@ -51,12 +44,14 @@ cr.define('options', function() {
* @private
*/
handleDisableBailoutShortcutChange_: function() {
- // Let default processing happening if user un-checks the box.
- if (!$('kiosk-disable-bailout-shortcut').checked)
+ // Just set the pref if user un-checks the box.
+ if (!$('kiosk-disable-bailout-shortcut').checked) {
+ chrome.send('setDisableBailoutShortcut', [false]);
return false;
+ }
// Otherwise, show the confirmation overlay.
- OptionsPage.showPageByName('kioskDisableBailoutConfirm', false);
+ ExtensionSettings.showOverlay($('kiosk-disable-bailout-confirm-overlay'));
return true;
}
};

Powered by Google App Engine
This is Rietveld 408576698