Index: chrome/browser/resources/options/easy_unlock_turn_off_overlay.js |
diff --git a/chrome/browser/resources/options/easy_unlock_turn_off_overlay.js b/chrome/browser/resources/options/easy_unlock_turn_off_overlay.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f1136a6c616e9b28e95c49026cfe12314167bf81 |
--- /dev/null |
+++ b/chrome/browser/resources/options/easy_unlock_turn_off_overlay.js |
@@ -0,0 +1,48 @@ |
+// Copyright 2014 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. |
+ |
+cr.define('options', function() { |
+ var Page = cr.ui.pageManager.Page; |
+ var PageManager = cr.ui.pageManager.PageManager; |
+ |
+ /** |
+ * EasyUnlockTurnOffOverlay class |
+ * Encapsulated handling of the Factory Reset confirmation overlay page. |
+ * @class |
+ */ |
+ function EasyUnlockTurnOffOverlay() { |
+ Page.call(this, 'easyUnlockTurnOffOverlay', |
+ loadTimeData.getString('easyUnlockTurnOffTitle'), |
+ 'easy-unlock-turn-off-overlay'); |
+ } |
+ |
+ cr.addSingletonGetter(EasyUnlockTurnOffOverlay); |
+ |
+ EasyUnlockTurnOffOverlay.prototype = { |
+ // Inherit EasyUnlockTurnOffOverlay from Page. |
+ __proto__: Page.prototype, |
+ |
+ /** @override */ |
+ initializePage: function() { |
+ Page.prototype.initializePage.call(this); |
+ |
+ $('easy-unlock-turn-off-dismiss').onclick = function(event) { |
+ EasyUnlockTurnOffOverlay.dismiss(); |
+ }; |
+ $('easy-unlock-turn-off-confirm').onclick = function(event) { |
+ var clearData = $('easy-unlock-clear-server-data').checked; |
+ chrome.send('turnOffEasyUnlock', [clearData]); |
+ }; |
+ }, |
+ }; |
+ |
+ EasyUnlockTurnOffOverlay.dismiss = function() { |
+ PageManager.closeOverlay(); |
+ }; |
+ |
+ // Export |
+ return { |
+ EasyUnlockTurnOffOverlay: EasyUnlockTurnOffOverlay |
+ }; |
+}); |