Index: chrome/browser/resources/md_user_manager/user_manager_pages.js |
diff --git a/chrome/browser/resources/md_user_manager/user_manager_pages.js b/chrome/browser/resources/md_user_manager/user_manager_pages.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..752a369bae8f407f9626fabfd9d2bc4f42c9fd91 |
--- /dev/null |
+++ b/chrome/browser/resources/md_user_manager/user_manager_pages.js |
@@ -0,0 +1,47 @@ |
+// 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-pages' is the element that controls paging in the |
+ * user manager screen. |
+ * |
+ * @element user-manager-pages |
+ */ |
+Polymer({ |
+ is: 'user-manager-pages', |
+ |
+ properties: { |
+ /** |
+ * ID of the currently selected page. |
+ * @private {string} |
+ */ |
+ selectedPage_: { |
+ type: String, |
+ value: 'user-pods-page' |
+ } |
+ }, |
+ |
+ listeners: { |
+ 'change-page': 'changePage_' |
+ }, |
+ |
+ /** |
+ * Changes the currently selected page. |
+ * @param {Event} e The event containing ID of the selected page. |
+ * @private |
+ */ |
+ changePage_: function(e) { |
+ this.selectedPage_ = e.detail.page; |
+ }, |
+ |
+ /** |
+ * Returns True if the given page should be visible. |
+ * @param {string} selectedPage ID of the currently selected page. |
+ * @param {string} page ID of the given page. |
+ * @return {boolean} |
+ */ |
+ isPageVisible_: function(selectedPage, page) { |
+ return this.selectedPage_ == page; |
+ } |
+}); |