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

Unified Diff: chrome/browser/resources/settings/settings_page/settings_page_visibility.js

Issue 1477773003: Use dom-if to hide settings pages and show explicitly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/settings/settings_page/settings_page_visibility.js
diff --git a/chrome/browser/resources/settings/settings_page/settings_page_visibility.js b/chrome/browser/resources/settings/settings_page/settings_page_visibility.js
new file mode 100644
index 0000000000000000000000000000000000000000..5e0e752cfbbb1bbc68a1bbcc71476c3ed55bc00f
--- /dev/null
+++ b/chrome/browser/resources/settings/settings_page/settings_page_visibility.js
@@ -0,0 +1,43 @@
+// Copyright 2015 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
+ * Behavior common to all Settings pages
+ *
+ * Example:
+ * behaviors: [SettingsPageVisibility],
+ *
+ * @group Chrome UI Behavior
+ */
+
+/**
+ * Set this to override page visibility, e.g. in tests.
+ * @type !Object|undefined
+ */
+var SettingPageDefaultVisibility;
+
+/** @polymerBehavior */
+var SettingsPageVisibility = {
+ properties: {
+ /** Dictionary of pages to hide. Includes 'basic' and 'advanced'. */
+ pageVisible: {
+ type: Object,
+ value: SettingPageDefaultVisibility,
+ notify: true,
+ },
+ },
+
+ /**
+ * Sets the visibility for each page in |pages| to true, causing it to load.
+ * @param {!Array<string>} pages
+ */
+ setVisiblePages(pages) {
+ var visible = this.pageVisible || {};
+ for (var p of pages) {
+ visible[p] = true;
+ }
+ this.set('pageVisible', visible);
+ }
+};

Powered by Google App Engine
This is Rietveld 408576698