Index: chrome/browser/resources/options/passwords_remove_all_overlay.js |
diff --git a/chrome/browser/resources/options/passwords_remove_all_overlay.js b/chrome/browser/resources/options/passwords_remove_all_overlay.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c081bbfbc2228cc13e7a46c350d4956d9dcb7232 |
--- /dev/null |
+++ b/chrome/browser/resources/options/passwords_remove_all_overlay.js |
@@ -0,0 +1,50 @@ |
+// Copyright (c) 2010 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 OptionsPage = options.OptionsPage; |
+ |
+ /** |
+ * PasswordsRemoveAllOverlay class |
+ * Encapsulated handling of the 'Remove All' overlay page. |
+ * @class |
+ */ |
+ function PasswordsRemoveAllOverlay() { |
+ OptionsPage.call(this, 'passwordsRemoveAllOverlay', |
+ templateData.remove_all_title, |
+ 'passwordsRemoveAllOverlay'); |
+ } |
+ |
+ cr.addSingletonGetter(PasswordsRemoveAllOverlay); |
+ |
+ PasswordsRemoveAllOverlay.prototype = { |
+ // Inherit StopSyncingOverlay from OptionsPage. |
+ __proto__: OptionsPage.prototype, |
+ |
+ /** |
+ * Initialize the page. |
+ */ |
+ initializePage: function() { |
+ // Call base class implementation to starts preference initialization. |
+ OptionsPage.prototype.initializePage.call(this); |
+ |
+ $('remove-all-cancel').onclick = function(e) { |
+ OptionsPage.clearOverlays(); |
+ } |
+ |
+ $('remove-all-confirm').onclick = function(e) { |
+ PasswordsExceptions.removeAllPasswords(); |
+ OptionsPage.clearOverlays(); |
+ } |
+ } |
+ }; |
+ |
+ // Export |
+ return { |
+ PasswordsRemoveAllOverlay: PasswordsRemoveAllOverlay |
+ }; |
+ |
+}); |
+ |