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

Side by Side Diff: chrome/browser/resources/settings/page_visibility.js

Issue 2962823002: MD Settings: decouple page visibility from settings_ui.html. (Closed)
Patch Set: moving import out of this CL Created 3 years, 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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 * Specifies page visibility in guest mode in cr and cros.
7 * @typedef {{
8 * advancedSettings: (boolean|undefined),
9 * appearance: (boolean|undefined|AppearancePageVisibility),
10 * dateTime: (boolean|undefined|DateTimePageVisibility),
11 * defaultBrowser: (boolean|undefined),
12 * downloads: (undefined|DownloadsPageVisibility),
13 * onStartup: (boolean|undefined),
14 * passwordsAndForms: (boolean|undefined),
15 * people: (boolean|undefined),
16 * privacy: (undefined|PrivacyPageVisibility),
17 * reset:(boolean|undefined),
18 * }}
19 */
20 var GuestModePageVisibility;
21
22 /**
23 * @typedef {{
24 * bookmarksBar: boolean,
25 * homeButton: boolean,
26 * pageZoom: boolean,
27 * setTheme: boolean,
28 * setWallpaper: boolean,
29 * }}
30 */
31 var AppearancePageVisibility;
32
33 /**
34 * @typedef {{
35 * timeZoneSelector: boolean,
36 * }}
37 */
38 var DateTimePageVisibility;
39
40 /**
41 * @typedef {{
42 * googleDrive: boolean
43 * }}
44 */
45 var DownloadsPageVisibility;
46
47 /**
48 * @typedef {{
49 * networkPrediction: boolean,
50 * searchPrediction: boolean,
51 * }}
52 */
53 var PrivacyPageVisibility;
54
55 cr.define('settings', function() {
56
57 /**
58 * Dictionary defining page visibility.
59 * This is only set when in guest mode. All pages are visible when not set
60 * because polymer only notifies after a property is set.
61 * @type {!GuestModePageVisibility}
62 */
63 var pageVisibility = {};
64
65 if (loadTimeData.getBoolean('isGuest')) {
66 // "if not chromeos" and "if chromeos" in two completely separate blocks
67 // to work around closure compiler.
68 // <if expr="not chromeos">
69 pageVisibility = {
70 passwordsAndForms: false,
71 people: false,
72 onStartup: false,
73 reset: false,
74 appearance: false,
75 defaultBrowser: false,
76 advancedSettings: false,
77 };
78 // </if>
79 // <if expr="chromeos">
80 pageVisibility = {
81 passwordsAndForms: false,
82 people: false,
83 onStartup: false,
84 reset: false,
85 appearance: {
86 setWallpaper: false,
87 setTheme: false,
88 homeButton: false,
89 bookmarksBar: false,
90 pageZoom: false,
91 },
92 advancedSettings: true,
93 privacy: {
94 searchPrediction: false,
95 networkPrediction: false,
96 },
97 downloads: {
98 googleDrive: false,
99 },
100 };
101 // </if>
102 }
103
104 return {pageVisibility: pageVisibility};
105 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698