summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-01-25 11:39:07 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-01-25 15:20:42 +0000
commit6c91641271e536ffaa88a1dff5127e42ee99a91e (patch)
tree703d9dd49602377ddc90cbf886aad37913f2496b /chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js
parentb145b7fafd36f0c260d6a768c81fc14e32578099 (diff)
downloadqtwebengine-chromium-6c91641271e536ffaa88a1dff5127e42ee99a91e.tar.gz
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources. Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js')
-rw-r--r--chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js b/chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js
new file mode 100644
index 00000000000..660d8e17d8b
--- /dev/null
+++ b/chromium/chrome/browser/resources/settings/settings_page/settings_page_visibility.js
@@ -0,0 +1,49 @@
+// 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 controlling the visibility of Settings pages.
+ *
+ * Example:
+ * behaviors: [SettingsPageVisibility],
+ *
+ * @group Chrome UI Behavior
+ */
+
+/**
+ * Set this to true in tests before loading the page (e.g. in preLoad()) so that
+ * pages do not initially get created. Set this to false BEFORE modifying
+ * pageVisibility. NOTE: Changing this value after the DOM is loaded will not
+ * trigger a visibility change, pageVisibility must be modified to trigger data
+ * binding events.
+ * @type {boolean}
+ */
+var settingsHidePagesByDefaultForTest;
+
+/** @polymerBehavior */
+var SettingsPageVisibility = {
+ properties: {
+ /**
+ * Dictionary defining page visibility. If not set for a page, visibility
+ * will default to true, unless settingsHidePagesByDefaultForTest is set
+ * in which case visibility defaults to false.
+ * @type {Object<boolean>}
+ */
+ pageVisibility: {
+ type: Object,
+ value: function() { return {}; },
+ },
+ },
+
+ /**
+ * @param {boolean} visibility
+ * @return {boolean}
+ */
+ showPage: function(visibility) {
+ if (settingsHidePagesByDefaultForTest)
+ return visibility === true;
+ return visibility !== false;
+ },
+};