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

Side by Side 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: Rebase Created 5 years 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview
7 * Behavior controlling the visibility of Settings pages.
8 *
9 * Example:
10 * behaviors: [SettingsPageVisibility],
11 *
12 * @group Chrome UI Behavior
13 */
14
15 /**
16 * Set this to true in tests before loading the page (e.g. in preLoad()) so that
17 * pages do not initially get created. Set this to false BEFORE modifying
18 * pageVisibility. NOTE: Changing this value after the DOM is loaded will not
19 * trigger a visibility change, pageVisibility must be modified to trigger data
20 * binding events.
21 * @type {boolean}
22 */
23 var settingsHideAllPagesForTest;
24
25 /** @polymerBehavior */
26 var SettingsPageVisibility = {
27 properties: {
28 /**
29 * Dictionary defining page visibility. If not set for a page, visibility
30 * will default to true (unless settingsHideAllPagesForTest is set).
31 * @type {Object<boolean>}
32 */
33 pageVisibility: {
34 type: Object,
35 value: function() { return {}; },
36 },
37 },
38
39 /**
40 * @param {boolean} visibility
41 * @return {boolean}
42 */
43 showPage: function(visibility) {
44 return !settingsHideAllPagesForTest && visibility !== false;
45 },
46 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698