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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 */ | 93 */ |
94 var UpdateStatusChangedEvent; | 94 var UpdateStatusChangedEvent; |
95 | 95 |
96 cr.define('settings', function() { | 96 cr.define('settings', function() { |
97 /** | 97 /** |
98 * @param {!BrowserChannel} channel | 98 * @param {!BrowserChannel} channel |
99 * @return {string} | 99 * @return {string} |
100 */ | 100 */ |
101 function browserChannelToI18nId(channel) { | 101 function browserChannelToI18nId(channel) { |
102 switch (channel) { | 102 switch (channel) { |
103 case BrowserChannel.BETA: return 'aboutChannelBeta'; | 103 case BrowserChannel.BETA: |
104 case BrowserChannel.DEV: return 'aboutChannelDev'; | 104 return 'aboutChannelBeta'; |
105 case BrowserChannel.STABLE: return 'aboutChannelStable'; | 105 case BrowserChannel.DEV: |
| 106 return 'aboutChannelDev'; |
| 107 case BrowserChannel.STABLE: |
| 108 return 'aboutChannelStable'; |
106 } | 109 } |
107 | 110 |
108 assertNotReached(); | 111 assertNotReached(); |
109 } | 112 } |
110 | 113 |
111 /** | 114 /** |
112 * @param {!BrowserChannel} currentChannel | 115 * @param {!BrowserChannel} currentChannel |
113 * @param {!BrowserChannel} targetChannel | 116 * @param {!BrowserChannel} targetChannel |
114 * @return {boolean} Whether the target channel is more stable than the | 117 * @return {boolean} Whether the target channel is more stable than the |
115 * current channel. | 118 * current channel. |
(...skipping 21 matching lines...) Expand all Loading... |
137 | 140 |
138 /** | 141 /** |
139 * Request update status from the browser. It results in one or more | 142 * Request update status from the browser. It results in one or more |
140 * 'update-status-changed' WebUI events. | 143 * 'update-status-changed' WebUI events. |
141 */ | 144 */ |
142 refreshUpdateStatus: function() {}, | 145 refreshUpdateStatus: function() {}, |
143 | 146 |
144 /** Opens the help page. */ | 147 /** Opens the help page. */ |
145 openHelpPage: function() {}, | 148 openHelpPage: function() {}, |
146 | 149 |
147 // <if expr="_google_chrome"> | 150 // <if expr="_google_chrome"> |
148 /** | 151 /** |
149 * Opens the feedback dialog. | 152 * Opens the feedback dialog. |
150 */ | 153 */ |
151 openFeedbackDialog: function() {}, | 154 openFeedbackDialog: function() {}, |
152 // </if> | 155 // </if> |
153 | 156 |
154 // <if expr="chromeos"> | 157 // <if expr="chromeos"> |
155 /** | 158 /** |
156 * Checks for available update and applies if it exists. | 159 * Checks for available update and applies if it exists. |
157 */ | 160 */ |
158 requestUpdate: function() {}, | 161 requestUpdate: function() {}, |
159 | 162 |
160 /** | 163 /** |
161 * Checks for the update with specified version and size and applies over | 164 * Checks for the update with specified version and size and applies over |
162 * cellular. The target version and size are the same as were received from | 165 * cellular. The target version and size are the same as were received from |
163 * 'update-status-changed' WebUI event. We send this back all the way to | 166 * 'update-status-changed' WebUI event. We send this back all the way to |
164 * update engine for it to double check with update server in case there's a | 167 * update engine for it to double check with update server in case there's a |
(...skipping 11 matching lines...) Expand all Loading... |
176 setChannel: function(channel, isPowerwashAllowed) {}, | 179 setChannel: function(channel, isPowerwashAllowed) {}, |
177 | 180 |
178 /** @return {!Promise<!ChannelInfo>} */ | 181 /** @return {!Promise<!ChannelInfo>} */ |
179 getChannelInfo: function() {}, | 182 getChannelInfo: function() {}, |
180 | 183 |
181 /** @return {!Promise<!VersionInfo>} */ | 184 /** @return {!Promise<!VersionInfo>} */ |
182 getVersionInfo: function() {}, | 185 getVersionInfo: function() {}, |
183 | 186 |
184 /** @return {!Promise<?RegulatoryInfo>} */ | 187 /** @return {!Promise<?RegulatoryInfo>} */ |
185 getRegulatoryInfo: function() {}, | 188 getRegulatoryInfo: function() {}, |
186 // </if> | 189 // </if> |
187 | 190 |
188 // <if expr="_google_chrome and is_macosx"> | 191 // <if expr="_google_chrome and is_macosx"> |
189 /** | 192 /** |
190 * Triggers setting up auto-updates for all users. | 193 * Triggers setting up auto-updates for all users. |
191 */ | 194 */ |
192 promoteUpdater: function() {}, | 195 promoteUpdater: function() {}, |
193 // </if> | 196 // </if> |
194 }; | 197 }; |
195 | 198 |
196 /** | 199 /** |
197 * @implements {settings.AboutPageBrowserProxy} | 200 * @implements {settings.AboutPageBrowserProxy} |
198 * @constructor | 201 * @constructor |
199 */ | 202 */ |
200 function AboutPageBrowserProxyImpl() {} | 203 function AboutPageBrowserProxyImpl() {} |
201 cr.addSingletonGetter(AboutPageBrowserProxyImpl); | 204 cr.addSingletonGetter(AboutPageBrowserProxyImpl); |
202 | 205 |
203 AboutPageBrowserProxyImpl.prototype = { | 206 AboutPageBrowserProxyImpl.prototype = { |
204 /** @override */ | 207 /** @override */ |
205 pageReady: function() { | 208 pageReady: function() { |
206 chrome.send('aboutPageReady'); | 209 chrome.send('aboutPageReady'); |
207 }, | 210 }, |
208 | 211 |
209 /** @override */ | 212 /** @override */ |
210 refreshUpdateStatus: function() { | 213 refreshUpdateStatus: function() { |
211 chrome.send('refreshUpdateStatus'); | 214 chrome.send('refreshUpdateStatus'); |
212 }, | 215 }, |
213 | 216 |
214 // <if expr="_google_chrome and is_macosx"> | 217 // <if expr="_google_chrome and is_macosx"> |
215 /** @override */ | 218 /** @override */ |
216 promoteUpdater: function() { | 219 promoteUpdater: function() { |
217 chrome.send('promoteUpdater'); | 220 chrome.send('promoteUpdater'); |
218 }, | 221 }, |
219 // </if> | 222 // </if> |
220 | 223 |
221 /** @override */ | 224 /** @override */ |
222 openHelpPage: function() { | 225 openHelpPage: function() { |
223 chrome.send('openHelpPage'); | 226 chrome.send('openHelpPage'); |
224 }, | 227 }, |
225 | 228 |
226 // <if expr="_google_chrome"> | 229 // <if expr="_google_chrome"> |
227 /** @override */ | 230 /** @override */ |
228 openFeedbackDialog: function() { | 231 openFeedbackDialog: function() { |
229 chrome.send('openFeedbackDialog'); | 232 chrome.send('openFeedbackDialog'); |
230 }, | 233 }, |
231 // </if> | 234 // </if> |
232 | 235 |
233 // <if expr="chromeos"> | 236 // <if expr="chromeos"> |
234 /** @override */ | 237 /** @override */ |
235 requestUpdate: function() { | 238 requestUpdate: function() { |
236 chrome.send('requestUpdate'); | 239 chrome.send('requestUpdate'); |
237 }, | 240 }, |
238 | 241 |
239 /** @override */ | 242 /** @override */ |
240 requestUpdateOverCellular: function(target_version, target_size) { | 243 requestUpdateOverCellular: function(target_version, target_size) { |
241 chrome.send('requestUpdateOverCellular', [target_version, target_size]); | 244 chrome.send('requestUpdateOverCellular', [target_version, target_size]); |
242 }, | 245 }, |
243 | 246 |
244 /** @override */ | 247 /** @override */ |
245 setChannel: function(channel, isPowerwashAllowed) { | 248 setChannel: function(channel, isPowerwashAllowed) { |
246 chrome.send('setChannel', [channel, isPowerwashAllowed]); | 249 chrome.send('setChannel', [channel, isPowerwashAllowed]); |
247 }, | 250 }, |
248 | 251 |
249 /** @override */ | 252 /** @override */ |
250 getChannelInfo: function() { | 253 getChannelInfo: function() { |
251 return cr.sendWithPromise('getChannelInfo'); | 254 return cr.sendWithPromise('getChannelInfo'); |
252 }, | 255 }, |
253 | 256 |
254 /** @override */ | 257 /** @override */ |
255 getVersionInfo: function() { | 258 getVersionInfo: function() { |
256 return cr.sendWithPromise('getVersionInfo'); | 259 return cr.sendWithPromise('getVersionInfo'); |
257 }, | 260 }, |
258 | 261 |
259 /** @override */ | 262 /** @override */ |
260 getRegulatoryInfo: function() { | 263 getRegulatoryInfo: function() { |
261 return cr.sendWithPromise('getRegulatoryInfo'); | 264 return cr.sendWithPromise('getRegulatoryInfo'); |
262 } | 265 } |
263 // </if> | 266 // </if> |
264 }; | 267 }; |
265 | 268 |
266 return { | 269 return { |
267 AboutPageBrowserProxy: AboutPageBrowserProxy, | 270 AboutPageBrowserProxy: AboutPageBrowserProxy, |
268 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, | 271 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, |
269 browserChannelToI18nId: browserChannelToI18nId, | 272 browserChannelToI18nId: browserChannelToI18nId, |
270 isTargetChannelMoreStable: isTargetChannelMoreStable, | 273 isTargetChannelMoreStable: isTargetChannelMoreStable, |
271 }; | 274 }; |
272 }); | 275 }); |
OLD | NEW |