Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: chrome/browser/resources/settings/about_page/about_page_browser_proxy.js

Issue 2617823002: GRIT: put <if> and <include> behind comments in .js files to make syntactically valid JS (Closed)
Patch Set: add dep Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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">
11 /** 11 /**
12 * @typedef {{ 12 * @typedef {{
13 * text: string, 13 * text: string,
14 * url: string, 14 * url: string,
15 * }} 15 * }}
16 */ 16 */
17 var RegulatoryInfo; 17 var RegulatoryInfo;
18 18
19 /** 19 /**
20 * @typedef {{ 20 * @typedef {{
(...skipping 15 matching lines...) Expand all
36 36
37 /** 37 /**
38 * Enumeration of all possible browser channels. 38 * Enumeration of all possible browser channels.
39 * @enum {string} 39 * @enum {string}
40 */ 40 */
41 var BrowserChannel = { 41 var BrowserChannel = {
42 BETA: 'beta-channel', 42 BETA: 'beta-channel',
43 DEV: 'dev-channel', 43 DEV: 'dev-channel',
44 STABLE: 'stable-channel', 44 STABLE: 'stable-channel',
45 }; 45 };
46 </if> 46 // </if>
47 47
48 /** 48 /**
49 * Enumeration of all possible update statuses. The string literals must match 49 * Enumeration of all possible update statuses. The string literals must match
50 * the ones defined at |AboutHandler::UpdateStatusToString|. 50 * the ones defined at |AboutHandler::UpdateStatusToString|.
51 * @enum {string} 51 * @enum {string}
52 */ 52 */
53 var UpdateStatus = { 53 var UpdateStatus = {
54 CHECKING: 'checking', 54 CHECKING: 'checking',
55 UPDATING: 'updating', 55 UPDATING: 'updating',
56 NEARLY_UPDATED: 'nearly_updated', 56 NEARLY_UPDATED: 'nearly_updated',
57 UPDATED: 'updated', 57 UPDATED: 'updated',
58 FAILED: 'failed', 58 FAILED: 'failed',
59 DISABLED: 'disabled', 59 DISABLED: 'disabled',
60 DISABLED_BY_ADMIN: 'disabled_by_admin', 60 DISABLED_BY_ADMIN: 'disabled_by_admin',
61 }; 61 };
62 62
63 <if expr="_google_chrome and is_macosx"> 63 // <if expr="_google_chrome and is_macosx">
64 /** 64 /**
65 * @typedef {{ 65 * @typedef {{
66 * hidden: boolean, 66 * hidden: boolean,
67 * disabled: boolean, 67 * disabled: boolean,
68 * actionable: boolean, 68 * actionable: boolean,
69 * text: (string|undefined) 69 * text: (string|undefined)
70 * }} 70 * }}
71 */ 71 */
72 var PromoteUpdaterStatus; 72 var PromoteUpdaterStatus;
73 </if> 73 // </if>
74 74
75 /** 75 /**
76 * @typedef {{ 76 * @typedef {{
77 * status: !UpdateStatus, 77 * status: !UpdateStatus,
78 * progress: (number|undefined), 78 * progress: (number|undefined),
79 * message: (string|undefined), 79 * message: (string|undefined),
80 * }} 80 * }}
81 */ 81 */
82 var UpdateStatusChangedEvent; 82 var UpdateStatusChangedEvent;
83 83
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 /** 126 /**
127 * Request update status from the browser. It results in one or more 127 * Request update status from the browser. It results in one or more
128 * 'update-status-changed' WebUI events. 128 * 'update-status-changed' WebUI events.
129 */ 129 */
130 refreshUpdateStatus: function() {}, 130 refreshUpdateStatus: function() {},
131 131
132 /** Opens the help page. */ 132 /** Opens the help page. */
133 openHelpPage: function() {}, 133 openHelpPage: function() {},
134 134
135 <if expr="_google_chrome"> 135 // <if expr="_google_chrome">
136 /** 136 /**
137 * Opens the feedback dialog. 137 * Opens the feedback dialog.
138 */ 138 */
139 openFeedbackDialog: function() {}, 139 openFeedbackDialog: function() {},
140 </if> 140 // </if>
141 141
142 <if expr="chromeos"> 142 // <if expr="chromeos">
143 /** 143 /**
144 * Checks for available update and applies if it exists. 144 * Checks for available update and applies if it exists.
145 */ 145 */
146 requestUpdate: function() {}, 146 requestUpdate: function() {},
147 147
148 /** 148 /**
149 * @param {!BrowserChannel} channel 149 * @param {!BrowserChannel} channel
150 * @param {boolean} isPowerwashAllowed 150 * @param {boolean} isPowerwashAllowed
151 */ 151 */
152 setChannel: function(channel, isPowerwashAllowed) {}, 152 setChannel: function(channel, isPowerwashAllowed) {},
153 153
154 /** @return {!Promise<!ChannelInfo>} */ 154 /** @return {!Promise<!ChannelInfo>} */
155 getChannelInfo: function() {}, 155 getChannelInfo: function() {},
156 156
157 /** @return {!Promise<!VersionInfo>} */ 157 /** @return {!Promise<!VersionInfo>} */
158 getVersionInfo: function() {}, 158 getVersionInfo: function() {},
159 159
160 /** @return {!Promise<?RegulatoryInfo>} */ 160 /** @return {!Promise<?RegulatoryInfo>} */
161 getRegulatoryInfo: function() {}, 161 getRegulatoryInfo: function() {},
162 </if> 162 // </if>
163 163
164 <if expr="_google_chrome and is_macosx"> 164 // <if expr="_google_chrome and is_macosx">
165 /** 165 /**
166 * Triggers setting up auto-updates for all users. 166 * Triggers setting up auto-updates for all users.
167 */ 167 */
168 promoteUpdater: function() {}, 168 promoteUpdater: function() {},
169 </if> 169 // </if>
170 }; 170 };
171 171
172 /** 172 /**
173 * @implements {settings.AboutPageBrowserProxy} 173 * @implements {settings.AboutPageBrowserProxy}
174 * @constructor 174 * @constructor
175 */ 175 */
176 function AboutPageBrowserProxyImpl() {} 176 function AboutPageBrowserProxyImpl() {}
177 cr.addSingletonGetter(AboutPageBrowserProxyImpl); 177 cr.addSingletonGetter(AboutPageBrowserProxyImpl);
178 178
179 AboutPageBrowserProxyImpl.prototype = { 179 AboutPageBrowserProxyImpl.prototype = {
180 /** @override */ 180 /** @override */
181 pageReady: function() { 181 pageReady: function() {
182 chrome.send('aboutPageReady'); 182 chrome.send('aboutPageReady');
183 }, 183 },
184 184
185 /** @override */ 185 /** @override */
186 refreshUpdateStatus: function() { 186 refreshUpdateStatus: function() {
187 chrome.send('refreshUpdateStatus'); 187 chrome.send('refreshUpdateStatus');
188 }, 188 },
189 189
190 <if expr="_google_chrome and is_macosx"> 190 // <if expr="_google_chrome and is_macosx">
191 /** @override */ 191 /** @override */
192 promoteUpdater: function() { 192 promoteUpdater: function() {
193 chrome.send('promoteUpdater'); 193 chrome.send('promoteUpdater');
194 }, 194 },
195 </if> 195 // </if>
196 196
197 /** @override */ 197 /** @override */
198 openHelpPage: function() { 198 openHelpPage: function() {
199 chrome.send('openHelpPage'); 199 chrome.send('openHelpPage');
200 }, 200 },
201 201
202 <if expr="_google_chrome"> 202 // <if expr="_google_chrome">
203 /** @override */ 203 /** @override */
204 openFeedbackDialog: function() { 204 openFeedbackDialog: function() {
205 chrome.send('openFeedbackDialog'); 205 chrome.send('openFeedbackDialog');
206 }, 206 },
207 </if> 207 // </if>
208 208
209 <if expr="chromeos"> 209 // <if expr="chromeos">
210 /** @override */ 210 /** @override */
211 requestUpdate: function() { 211 requestUpdate: function() {
212 chrome.send('requestUpdate'); 212 chrome.send('requestUpdate');
213 }, 213 },
214 214
215 /** @override */ 215 /** @override */
216 setChannel: function(channel, isPowerwashAllowed) { 216 setChannel: function(channel, isPowerwashAllowed) {
217 chrome.send('setChannel', [channel, isPowerwashAllowed]); 217 chrome.send('setChannel', [channel, isPowerwashAllowed]);
218 }, 218 },
219 219
220 /** @override */ 220 /** @override */
221 getChannelInfo: function() { 221 getChannelInfo: function() {
222 return cr.sendWithPromise('getChannelInfo'); 222 return cr.sendWithPromise('getChannelInfo');
223 }, 223 },
224 224
225 /** @override */ 225 /** @override */
226 getVersionInfo: function() { 226 getVersionInfo: function() {
227 return cr.sendWithPromise('getVersionInfo'); 227 return cr.sendWithPromise('getVersionInfo');
228 }, 228 },
229 229
230 /** @override */ 230 /** @override */
231 getRegulatoryInfo: function() { 231 getRegulatoryInfo: function() {
232 return cr.sendWithPromise('getRegulatoryInfo'); 232 return cr.sendWithPromise('getRegulatoryInfo');
233 } 233 }
234 </if> 234 // </if>
235 }; 235 };
236 236
237 return { 237 return {
238 AboutPageBrowserProxy: AboutPageBrowserProxy, 238 AboutPageBrowserProxy: AboutPageBrowserProxy,
239 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl, 239 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl,
240 browserChannelToI18nId: browserChannelToI18nId, 240 browserChannelToI18nId: browserChannelToI18nId,
241 isTargetChannelMoreStable: isTargetChannelMoreStable, 241 isTargetChannelMoreStable: isTargetChannelMoreStable,
242 }; 242 };
243 }); 243 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698