| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 A helper object used from the "About" section to interact with | 6 * @fileoverview A helper object used from the "About" section to interact with |
| 7 * the browser. | 7 * the browser. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 // <if expr="chromeos"> | 10 // <if expr="chromeos"> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 BrowserChannel.DEV, | 123 BrowserChannel.DEV, |
| 124 BrowserChannel.BETA, | 124 BrowserChannel.BETA, |
| 125 BrowserChannel.STABLE, | 125 BrowserChannel.STABLE, |
| 126 ]; | 126 ]; |
| 127 var currentIndex = channelList.indexOf(currentChannel); | 127 var currentIndex = channelList.indexOf(currentChannel); |
| 128 var targetIndex = channelList.indexOf(targetChannel); | 128 var targetIndex = channelList.indexOf(targetChannel); |
| 129 return currentIndex < targetIndex; | 129 return currentIndex < targetIndex; |
| 130 } | 130 } |
| 131 | 131 |
| 132 /** @interface */ | 132 /** @interface */ |
| 133 function AboutPageBrowserProxy() {} | 133 class AboutPageBrowserProxy { |
| 134 | |
| 135 AboutPageBrowserProxy.prototype = { | |
| 136 /** | 134 /** |
| 137 * Indicates to the browser that the page is ready. | 135 * Indicates to the browser that the page is ready. |
| 138 */ | 136 */ |
| 139 pageReady: function() {}, | 137 pageReady() {} |
| 140 | 138 |
| 141 /** | 139 /** |
| 142 * Request update status from the browser. It results in one or more | 140 * Request update status from the browser. It results in one or more |
| 143 * 'update-status-changed' WebUI events. | 141 * 'update-status-changed' WebUI events. |
| 144 */ | 142 */ |
| 145 refreshUpdateStatus: function() {}, | 143 refreshUpdateStatus() {} |
| 146 | 144 |
| 147 /** Opens the help page. */ | 145 /** Opens the help page. */ |
| 148 openHelpPage: function() {}, | 146 openHelpPage() {} |
| 149 | 147 |
| 150 // <if expr="_google_chrome"> | 148 // <if expr="_google_chrome"> |
| 151 /** | 149 /** |
| 152 * Opens the feedback dialog. | 150 * Opens the feedback dialog. |
| 153 */ | 151 */ |
| 154 openFeedbackDialog: function() {}, | 152 openFeedbackDialog() {} |
| 153 |
| 155 // </if> | 154 // </if> |
| 156 | 155 |
| 157 // <if expr="chromeos"> | 156 // <if expr="chromeos"> |
| 158 /** | 157 /** |
| 159 * Checks for available update and applies if it exists. | 158 * Checks for available update and applies if it exists. |
| 160 */ | 159 */ |
| 161 requestUpdate: function() {}, | 160 requestUpdate() {} |
| 162 | 161 |
| 163 /** | 162 /** |
| 164 * Checks for the update with specified version and size and applies over | 163 * Checks for the update with specified version and size and applies over |
| 165 * cellular. The target version and size are the same as were received from | 164 * cellular. The target version and size are the same as were received from |
| 166 * 'update-status-changed' WebUI event. We send this back all the way to | 165 * 'update-status-changed' WebUI event. We send this back all the way to |
| 167 * update engine for it to double check with update server in case there's a | 166 * update engine for it to double check with update server in case there's a |
| 168 * new update available. This prevents downloading the new update that user | 167 * new update available. This prevents downloading the new update that user |
| 169 * didn't agree to. | 168 * didn't agree to. |
| 170 * @param {string} target_version | 169 * @param {string} target_version |
| 171 * @param {string} target_size | 170 * @param {string} target_size |
| 172 */ | 171 */ |
| 173 requestUpdateOverCellular: function(target_version, target_size) {}, | 172 requestUpdateOverCellular(target_version, target_size) {} |
| 174 | 173 |
| 175 /** | 174 /** |
| 176 * @param {!BrowserChannel} channel | 175 * @param {!BrowserChannel} channel |
| 177 * @param {boolean} isPowerwashAllowed | 176 * @param {boolean} isPowerwashAllowed |
| 178 */ | 177 */ |
| 179 setChannel: function(channel, isPowerwashAllowed) {}, | 178 setChannel(channel, isPowerwashAllowed) {} |
| 180 | 179 |
| 181 /** @return {!Promise<!ChannelInfo>} */ | 180 /** @return {!Promise<!ChannelInfo>} */ |
| 182 getChannelInfo: function() {}, | 181 getChannelInfo() {} |
| 183 | 182 |
| 184 /** @return {!Promise<!VersionInfo>} */ | 183 /** @return {!Promise<!VersionInfo>} */ |
| 185 getVersionInfo: function() {}, | 184 getVersionInfo() {} |
| 186 | 185 |
| 187 /** @return {!Promise<?RegulatoryInfo>} */ | 186 /** @return {!Promise<?RegulatoryInfo>} */ |
| 188 getRegulatoryInfo: function() {}, | 187 getRegulatoryInfo() {} |
| 188 |
| 189 // </if> | 189 // </if> |
| 190 | 190 |
| 191 // <if expr="_google_chrome and is_macosx"> | 191 // <if expr="_google_chrome and is_macosx"> |
| 192 /** | 192 /** |
| 193 * Triggers setting up auto-updates for all users. | 193 * Triggers setting up auto-updates for all users. |
| 194 */ | 194 */ |
| 195 promoteUpdater: function() {}, | 195 promoteUpdater() {} |
| 196 // </if> | 196 // </if> |
| 197 }; | 197 } |
| 198 | 198 |
| 199 /** | 199 /** |
| 200 * @implements {settings.AboutPageBrowserProxy} | 200 * @implements {settings.AboutPageBrowserProxy} |
| 201 * @constructor | |
| 202 */ | 201 */ |
| 203 function AboutPageBrowserProxyImpl() {} | 202 class AboutPageBrowserProxyImpl { |
| 204 cr.addSingletonGetter(AboutPageBrowserProxyImpl); | |
| 205 | |
| 206 AboutPageBrowserProxyImpl.prototype = { | |
| 207 /** @override */ | 203 /** @override */ |
| 208 pageReady: function() { | 204 pageReady() { |
| 209 chrome.send('aboutPageReady'); | 205 chrome.send('aboutPageReady'); |
| 210 }, | 206 } |
| 211 | 207 |
| 212 /** @override */ | 208 /** @override */ |
| 213 refreshUpdateStatus: function() { | 209 refreshUpdateStatus() { |
| 214 chrome.send('refreshUpdateStatus'); | 210 chrome.send('refreshUpdateStatus'); |
| 215 }, | 211 } |
| 216 | 212 |
| 217 // <if expr="_google_chrome and is_macosx"> | 213 // <if expr="_google_chrome and is_macosx"> |
| 218 /** @override */ | 214 /** @override */ |
| 219 promoteUpdater: function() { | 215 promoteUpdater() { |
| 220 chrome.send('promoteUpdater'); | 216 chrome.send('promoteUpdater'); |
| 221 }, | 217 } |
| 218 |
| 222 // </if> | 219 // </if> |
| 223 | 220 |
| 224 /** @override */ | 221 /** @override */ |
| 225 openHelpPage: function() { | 222 openHelpPage() { |
| 226 chrome.send('openHelpPage'); | 223 chrome.send('openHelpPage'); |
| 227 }, | 224 } |
| 228 | 225 |
| 229 // <if expr="_google_chrome"> | 226 // <if expr="_google_chrome"> |
| 230 /** @override */ | 227 /** @override */ |
| 231 openFeedbackDialog: function() { | 228 openFeedbackDialog() { |
| 232 chrome.send('openFeedbackDialog'); | 229 chrome.send('openFeedbackDialog'); |
| 233 }, | 230 } |
| 231 |
| 234 // </if> | 232 // </if> |
| 235 | 233 |
| 236 // <if expr="chromeos"> | 234 // <if expr="chromeos"> |
| 237 /** @override */ | 235 /** @override */ |
| 238 requestUpdate: function() { | 236 requestUpdate() { |
| 239 chrome.send('requestUpdate'); | 237 chrome.send('requestUpdate'); |
| 240 }, | 238 } |
| 241 | 239 |
| 242 /** @override */ | 240 /** @override */ |
| 243 requestUpdateOverCellular: function(target_version, target_size) { | 241 requestUpdateOverCellular(target_version, target_size) { |
| 244 chrome.send('requestUpdateOverCellular', [target_version, target_size]); | 242 chrome.send('requestUpdateOverCellular', [target_version, target_size]); |
| 245 }, | 243 } |
| 246 | 244 |
| 247 /** @override */ | 245 /** @override */ |
| 248 setChannel: function(channel, isPowerwashAllowed) { | 246 setChannel(channel, isPowerwashAllowed) { |
| 249 chrome.send('setChannel', [channel, isPowerwashAllowed]); | 247 chrome.send('setChannel', [channel, isPowerwashAllowed]); |
| 250 }, | 248 } |
| 251 | 249 |
| 252 /** @override */ | 250 /** @override */ |
| 253 getChannelInfo: function() { | 251 getChannelInfo() { |
| 254 return cr.sendWithPromise('getChannelInfo'); | 252 return cr.sendWithPromise('getChannelInfo'); |
| 255 }, | 253 } |
| 256 | 254 |
| 257 /** @override */ | 255 /** @override */ |
| 258 getVersionInfo: function() { | 256 getVersionInfo() { |
| 259 return cr.sendWithPromise('getVersionInfo'); | 257 return cr.sendWithPromise('getVersionInfo'); |
| 260 }, | 258 } |
| 261 | 259 |
| 262 /** @override */ | 260 /** @override */ |
| 263 getRegulatoryInfo: function() { | 261 getRegulatoryInfo() { |
| 264 return cr.sendWithPromise('getRegulatoryInfo'); | 262 return cr.sendWithPromise('getRegulatoryInfo'); |
| 265 } | 263 } |
| 266 // </if> | 264 // </if> |
| 267 }; | 265 } |
| 266 |
| 267 cr.addSingletonGetter(AboutPageBrowserProxyImpl); |
| 268 | 268 |
| 269 return { | 269 return { |
| 270 AboutPageBrowserProxy: AboutPageBrowserProxy, | 270 AboutPageBrowserProxy: AboutPageBrowserProxy, |
| 271 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, | 271 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, |
| 272 browserChannelToI18nId: browserChannelToI18nId, | 272 browserChannelToI18nId: browserChannelToI18nId, |
| 273 isTargetChannelMoreStable: isTargetChannelMoreStable, | 273 isTargetChannelMoreStable: isTargetChannelMoreStable, |
| 274 }; | 274 }; |
| 275 }); | 275 }); |
| OLD | NEW |