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

Unified Diff: chrome/browser/resources/md_user_manager/user_manager_dialog.js

Issue 2024233003: MD User Manager: Refactors existing dialogs in User Manager into <user-manager-dialog> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@md-user-manager-locked-test
Patch Set: Removed user_manager_dialog gyp target Created 4 years, 6 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/md_user_manager/user_manager_dialog.js
diff --git a/chrome/browser/resources/md_user_manager/user_manager_dialog.js b/chrome/browser/resources/md_user_manager/user_manager_dialog.js
new file mode 100644
index 0000000000000000000000000000000000000000..6db1a35475ec2c59d0c5defb86dfba2a85eb314e
--- /dev/null
+++ b/chrome/browser/resources/md_user_manager/user_manager_dialog.js
@@ -0,0 +1,72 @@
+// Copyright 2016 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.
+
+/**
+ * @fileoverview 'user-manager-dialog' is a modal dialog for the user manager.
+ */
+Polymer({
+ is: 'user-manager-dialog',
+
+ behaviors: [Polymer.PaperDialogBehavior],
+
+ properties: {
+ /** @override */
+ noCancelOnOutsideClick: {
+ type: Boolean,
+ value: true
+ },
+
+ /** @override */
+ withBackdrop: {
+ type: Boolean,
+ value: true
+ },
+
+ /**
+ * The first node that can receive focus.
+ * @type {!Node}
+ */
+ firstFocusableNode: {
+ type: Object,
+ value: function() { return this.$.close; },
+ observer: 'firstFocusableNodeChanged_'
+ },
+
+ /**
+ * The last node that can receive focus.
+ * @type {!Node}
+ */
+ lastFocusableNode: {
+ type: Object,
+ value: function() { return this.$.close; },
+ observer: 'lastFocusableNodeChanged_'
+ }
+ },
+
+ /**
+ * Returns the first and the last focusable elements in order to wrap the
+ * focus for the dialog in Polymer.PaperDialogBehavior.
+ * @override
+ * @type {!Array<!Node>}
+ */
+ get _focusableNodes() {
+ return [this.firstFocusableNode, this.lastFocusableNode];
+ },
+
+ /**
+ * Observer for firstFocusableNode. Updates __firstFocusableNode in
+ * Polymer.PaperDialogBehavior.
+ */
+ firstFocusableNodeChanged_: function(newValue) {
+ this.__firstFocusableNode = newValue;
+ },
+
+ /**
+ * Observer for lastFocusableNodeChanged_. Updates __lastFocusableNode in
+ * Polymer.PaperDialogBehavior.
+ */
+ lastFocusableNodeChanged_: function(newValue) {
+ this.__lastFocusableNode = newValue;
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698