| 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 * |
| 11 * <settings-ui prefs="{{prefs}}"></settings-ui> | 11 * <settings-ui prefs="{{prefs}}"></settings-ui> |
| 12 */ | 12 */ |
| 13 Polymer({ | 13 Polymer({ |
| 14 is: 'settings-ui', | 14 is: 'settings-ui', |
| 15 | 15 |
| 16 properties: { | 16 properties: { |
| 17 /** | 17 /** |
| 18 * Preferences state. | 18 * Preferences state. |
| 19 */ | 19 */ |
| 20 prefs: Object, | 20 prefs: Object, |
| 21 | 21 |
| 22 /** @type {?settings.DirectionDelegate} */ | 22 /** @type {?settings.DirectionDelegate} */ |
| 23 directionDelegate: { | 23 directionDelegate: { |
| 24 observer: 'directionDelegateChanged_', | 24 observer: 'directionDelegateChanged_', |
| 25 type: Object, | 25 type: Object, |
| 26 }, | 26 }, |
| 27 | 27 |
| 28 /** @private */ | |
| 29 appealClosed_: { | |
| 30 type: Boolean, | |
| 31 value: function() { | |
| 32 return !!(window.sessionStorage.appealClosed_ || | |
| 33 window.localStorage.appealClosed_); | |
| 34 }, | |
| 35 }, | |
| 36 | |
| 37 /** @private */ | |
| 38 appealBugUrl_: { | |
| 39 type: String, | |
| 40 value: function() { | |
| 41 var url = | |
| 42 'https://bugs.chromium.org/p/chromium/issues/entry?' + | |
| 43 'labels=Proj-MaterialDesign-WebUI,Pri-2,Type-Bug&' + | |
| 44 'components=UI%3ESettings&description='; | |
| 45 var description = | |
| 46 'What steps will reproduce the problem?\n' + | |
| 47 '(1) \n(2) \n(3) \n\nWhat is the expected result?\n\n\n' + | |
| 48 'What happens instead?\n\n\nPlease provide any additional ' + | |
| 49 'information below. Attach a screenshot if possible.\n\n'; | |
| 50 var version = navigator.userAgent.match(/Chrom(?:e|ium)\/([\d.]+)/); | |
| 51 if (version) | |
| 52 description += 'Version: ' + version[1]; | |
| 53 url += encodeURIComponent(description); | |
| 54 return url; | |
| 55 }, | |
| 56 }, | |
| 57 | |
| 58 /** @private {boolean} */ | 28 /** @private {boolean} */ |
| 59 toolbarSpinnerActive_: { | 29 toolbarSpinnerActive_: { |
| 60 type: Boolean, | 30 type: Boolean, |
| 61 value: false, | 31 value: false, |
| 62 }, | 32 }, |
| 63 | 33 |
| 64 /** | 34 /** |
| 65 * Dictionary defining page visibility. | 35 * Dictionary defining page visibility. |
| 66 * @private {!GuestModePageVisibility} | 36 * @private {!GuestModePageVisibility} |
| 67 */ | 37 */ |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 }, | 84 }, |
| 115 passwordsAndForms: false, | 85 passwordsAndForms: false, |
| 116 downloads: { | 86 downloads: { |
| 117 googleDrive: false, | 87 googleDrive: false, |
| 118 }, | 88 }, |
| 119 </if> | 89 </if> |
| 120 }; | 90 }; |
| 121 } | 91 } |
| 122 }, | 92 }, |
| 123 | 93 |
| 124 /** @private */ | |
| 125 onCloseAppealTap_: function() { | |
| 126 window.sessionStorage.appealClosed_ = this.appealClosed_ = true; | |
| 127 }, | |
| 128 | |
| 129 /** | 94 /** |
| 130 * @param {Event} event | 95 * @param {Event} event |
| 131 * @private | 96 * @private |
| 132 */ | 97 */ |
| 133 onIronActivate_: function(event) { | 98 onIronActivate_: function(event) { |
| 134 if (event.detail.item.id != 'advancedPage') | 99 if (event.detail.item.id != 'advancedPage') |
| 135 this.$$('app-drawer').close(); | 100 this.$$('app-drawer').close(); |
| 136 }, | 101 }, |
| 137 | 102 |
| 138 /** @private */ | 103 /** @private */ |
| 139 onMenuButtonTap_: function() { | 104 onMenuButtonTap_: function() { |
| 140 this.$$('app-drawer').toggle(); | 105 this.$$('app-drawer').toggle(); |
| 141 }, | 106 }, |
| 142 | 107 |
| 143 /** @private */ | 108 /** @private */ |
| 144 directionDelegateChanged_: function() { | 109 directionDelegateChanged_: function() { |
| 145 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? | 110 this.$$('app-drawer').align = this.directionDelegate.isRtl() ? |
| 146 'right' : 'left'; | 111 'right' : 'left'; |
| 147 }, | 112 }, |
| 148 }); | 113 }); |
| OLD | NEW |