OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-ui' implements the UI for the Settings page. | 7 * 'settings-ui' implements the UI for the Settings page. |
8 * | 8 * |
9 * Example: | 9 * Example: |
10 * | 10 * |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 url += encodeURIComponent(description); | 53 url += encodeURIComponent(description); |
54 return url; | 54 return url; |
55 }, | 55 }, |
56 }, | 56 }, |
57 | 57 |
58 /** @private {boolean} */ | 58 /** @private {boolean} */ |
59 toolbarSpinnerActive_: { | 59 toolbarSpinnerActive_: { |
60 type: Boolean, | 60 type: Boolean, |
61 value: false, | 61 value: false, |
62 }, | 62 }, |
| 63 |
| 64 /** |
| 65 * Dictionary defining page visibility. |
| 66 * @private {!GuestModePageVisibility} |
| 67 */ |
| 68 pageVisibility_: Object, |
63 }, | 69 }, |
64 | 70 |
65 listeners: { | 71 listeners: { |
66 'sideNav.iron-activate': 'onIronActivate_', | 72 'sideNav.iron-activate': 'onIronActivate_', |
67 }, | 73 }, |
68 | 74 |
69 /** @override */ | 75 /** |
| 76 * @override |
| 77 * @suppress {es5Strict} Object literals cannot contain duplicate keys in ES5 |
| 78 * strict mode. |
| 79 */ |
70 ready: function() { | 80 ready: function() { |
71 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { | 81 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { |
72 this.$$('settings-main').searchContents(e.detail); | 82 this.$$('settings-main').searchContents(e.detail); |
73 }.bind(this)); | 83 }.bind(this)); |
74 | 84 |
75 window.addEventListener('popstate', function(e) { | 85 window.addEventListener('popstate', function(e) { |
76 this.$$('app-drawer').close(); | 86 this.$$('app-drawer').close(); |
77 }.bind(this)); | 87 }.bind(this)); |
| 88 |
| 89 if (loadTimeData.getBoolean('isGuest')) { |
| 90 this.pageVisibility_ = { |
| 91 people: false, |
| 92 onStartup: false, |
| 93 reset: false, |
| 94 <if expr="not chromeos"> |
| 95 appearance: false, |
| 96 defaultBrowser: false, |
| 97 advancedSettings: false, |
| 98 </if> |
| 99 <if expr="chromeos"> |
| 100 appearance: { |
| 101 setWallpaper: false, |
| 102 setTheme: false, |
| 103 homeButton: false, |
| 104 bookmarksBar: false, |
| 105 pageZoom: false, |
| 106 }, |
| 107 advancedSettings: true, |
| 108 dateTime: { |
| 109 timeZoneSelector: false, |
| 110 }, |
| 111 privacy: { |
| 112 searchPrediction: false, |
| 113 networkPrediction: false, |
| 114 }, |
| 115 passwordsAndForms: false, |
| 116 downloads: { |
| 117 googleDrive: false, |
| 118 }, |
| 119 </if> |
| 120 }; |
| 121 } |
78 }, | 122 }, |
79 | 123 |
80 /** @private */ | 124 /** @private */ |
81 onCloseAppealTap_: function() { | 125 onCloseAppealTap_: function() { |
82 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; | 126 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; |
83 }, | 127 }, |
84 | 128 |
85 /** | 129 /** |
86 * @param {Event} event | 130 * @param {Event} event |
87 * @private | 131 * @private |
88 */ | 132 */ |
89 onIronActivate_: function(event) { | 133 onIronActivate_: function(event) { |
90 if (event.detail.item.id != 'advancedPage') | 134 if (event.detail.item.id != 'advancedPage') |
91 this.$$('app-drawer').close(); | 135 this.$$('app-drawer').close(); |
92 }, | 136 }, |
93 | 137 |
94 /** @private */ | 138 /** @private */ |
95 onMenuButtonTap_: function() { | 139 onMenuButtonTap_: function() { |
96 this.$$('app-drawer').toggle(); | 140 this.$$('app-drawer').toggle(); |
97 }, | 141 }, |
98 | 142 |
99 /** @private */ | 143 /** @private */ |
100 directionDelegateChanged_: function() { | 144 directionDelegateChanged_: function() { |
101 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 145 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
102 'right' : 'left'; | 146 'right' : 'left'; |
103 }, | 147 }, |
104 }); | 148 }); |
OLD | NEW |