Chromium Code Reviews| 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_: { | |
| 69 type: Object, | |
| 70 }, | |
| 63 }, | 71 }, |
| 64 | 72 |
| 65 listeners: { | 73 listeners: { |
| 66 'sideNav.iron-activate': 'onIronActivate_', | 74 'sideNav.iron-activate': 'onIronActivate_', |
| 67 }, | 75 }, |
| 68 | 76 |
| 77 /** | |
| 78 * @override | |
| 79 * @suppress {es5Strict} Object literals cannot contain duplicate keys in ES5 | |
| 80 * strict mode. | |
| 81 */ | |
| 82 ready: function() { | |
| 83 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { | |
| 84 this.$$('settings-main').searchContents(e.detail); | |
| 85 }.bind(this)); | |
| 86 | |
| 87 if (loadTimeData.getBoolean('isGuest')) { | |
|
dpapad
2016/07/22 22:40:48
Can you not move this logic at line 69 as follows?
Moe
2016/07/24 23:54:27
Unfortunately not. @suppress won't work for declar
| |
| 88 this.pageVisibility_ = { | |
| 89 people: false, | |
| 90 onStartup: false, | |
| 91 reset: false, | |
| 92 <if expr="not chromeos"> | |
| 93 appearance: false, | |
| 94 defaultBrowser: false, | |
| 95 advancedSettings: false, | |
| 96 </if> | |
| 97 <if expr="chromeos"> | |
| 98 appearance: { | |
| 99 setWallpaper: false, | |
| 100 setTheme: false, | |
| 101 homeButton: false, | |
| 102 bookmarksBar: false, | |
| 103 pageZoom: false, | |
| 104 }, | |
| 105 advancedSettings: true, | |
| 106 dateTime: { | |
| 107 timeZoneSelector: false, | |
| 108 }, | |
| 109 privacy: { | |
| 110 searchPrediction: false, | |
| 111 networkPrediction: false, | |
| 112 }, | |
| 113 passwordsAndForms: false, | |
| 114 downloads: { | |
| 115 googleDrive: false, | |
| 116 }, | |
| 117 </if> | |
| 118 }; | |
| 119 } | |
| 120 }, | |
| 121 | |
| 69 /** @private */ | 122 /** @private */ |
| 70 onCloseAppealTap_: function() { | 123 onCloseAppealTap_: function() { |
| 71 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; | 124 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; |
| 72 }, | 125 }, |
| 73 | 126 |
| 74 /** | 127 /** |
| 75 * @param {Event} event | 128 * @param {Event} event |
| 76 * @private | 129 * @private |
| 77 */ | 130 */ |
| 78 onIronActivate_: function(event) { | 131 onIronActivate_: function(event) { |
| 79 if (event.detail.item.id != 'advancedPage') | 132 if (event.detail.item.id != 'advancedPage') |
| 80 this.$$('app-drawer').close(); | 133 this.$$('app-drawer').close(); |
| 81 }, | 134 }, |
| 82 | 135 |
| 83 /** @private */ | 136 /** @private */ |
| 84 onMenuButtonTap_: function() { | 137 onMenuButtonTap_: function() { |
| 85 this.$$('app-drawer').toggle(); | 138 this.$$('app-drawer').toggle(); |
| 86 }, | 139 }, |
| 87 | 140 |
| 88 /** @override */ | |
| 89 ready: function() { | |
| 90 this.$$('cr-toolbar').addEventListener('search-changed', function(e) { | |
| 91 this.$$('settings-main').searchContents(e.detail); | |
| 92 }.bind(this)); | |
| 93 }, | |
| 94 | |
| 95 /** @private */ | 141 /** @private */ |
| 96 directionDelegateChanged_: function() { | 142 directionDelegateChanged_: function() { |
| 97 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 143 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
| 98 'right' : 'left'; | 144 'right' : 'left'; |
| 99 }, | 145 }, |
| 100 }); | 146 }); |
| OLD | NEW |