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

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

Issue 1971483002: MD Settings: About page, porting C++ handler and adding browser proxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add proxy and handlers. Created 4 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 /**
6 * @fileoverview A helper object used from the "About" section to interact with
7 * the browser.
8 */
9
10 /**
11 * @typedef {{
12 * text: string,
13 * url: string,
14 * }}
15 */
16 var RegulatoryInfo;
tommycli 2016/05/10 20:45:39 If this is indeed used only in chromeos, can we <i
dpapad 2016/05/10 22:03:02 Done.
17
18 cr.define('settings', function() {
19 /**
20 * Enumeration of all possible browser channels.
21 * @enum {string}
22 */
23 var BrowserChannel = {
24 BETA: 'beta-channel',
25 DEV: 'dev-channel',
26 STABLE: 'stable-channel',
27 };
28
29 /** @interface */
30 function AboutPageBrowserProxy() {}
31
32 AboutPageBrowserProxy.prototype = {
33 /**
34 * Called once the page is ready. It results in one or more
35 * 'update-status-changed' WebUI events.
36 */
37 refreshUpdateStatus: function() {},
38
39 /**
40 * Relaunches the browser.
41 */
42 relaunchNow: function() {},
43
44 /** Opens the help page. */
45 openHelpPage: function() {},
46
47 <if expr="_google_chrome">
48 /**
49 * Opens the feedback dialog.
50 */
51 openFeedbackDialog: function() {},
52 </if>
53
54 <if expr="chromeos">
55 requestUpdate: function() {},
tommycli 2016/05/10 20:45:39 Does this one need a comment also?
dpapad 2016/05/10 22:03:02 Done.
56
57 /**
58 * @param {!BrowserChannel} channel
59 * @param {boolean} isPowerwashAllowed
60 */
61 setChannel: function(channel, isPowerwashAllowed) {},
62
63 /** @return {!Promise<string>} */
64 getCurrentChannel: function() {},
65
66 /** @return {!Promise<string>} */
67 getTargetChannel: function() {},
68
69 /** @return {!Promise<string>} */
70 getOsVersion: function() {},
71
72 /** @return {!Promise<string>} */
73 getOsFirmware: function() {},
74
75 /** @return {!Promise<string>} */
76 getArcVersion: function() {},
77
78 /** @return {!Promise<?RegulatoryInfo>} */
79 getRegulatoryInfo: function() {},
80 </if>
81 };
82
83 /**
84 * @implements {settings.AboutPageBrowserProxy}
85 * @constructor
86 */
87 function AboutPageBrowserProxyImpl() {}
88 cr.addSingletonGetter(AboutPageBrowserProxyImpl);
89
90 AboutPageBrowserProxyImpl.prototype = {
91 /** @override */
92 refreshUpdateStatus: function() {
93 chrome.send('refreshUpdateStatus');
94 },
95
96 /** @override */
97 relaunchNow: function() {
98 chrome.send('relaunchNow');
99 },
100
101 /** @override */
102 openHelpPage: function() {
103 chrome.send('openHelpPage');
104 },
105
106 <if expr="_google_chrome">
107 /** @override */
108 openFeedbackDialog: function() {
109 chrome.send('openFeedbackDialog');
110 },
111 </if>
112
113 <if expr="chromeos">
114 /** @override */
115 requestUpdate: function() {
116 chrome.send('requestUpdate');
117 },
118
119 /** @override */
120 setChannel: function(channel, isPowerwashAllowed) {
121 chrome.send('setChannel', [channel, isPowerwashAllowed]);
122 },
123
124 /** @override */
125 getCurrentChannel: function() {
126 return cr.sendWithPromise('getCurrentChannel');
127 },
128
129 /** @override */
130 getTargetChannel: function() {
131 return cr.sendWithPromise('getTargetChannel');
132 },
133
134 /** @override */
135 getOsVersion: function() {
136 return cr.sendWithPromise('getOsVersion');
137 },
138
139 /** @override */
140 getOsFirmware: function() {
141 return cr.sendWithPromise('getOsFirmware');
142 },
143
144 /** @override */
145 getArcVersion: function() {
146 return cr.sendWithPromise('getArcVersion');
147 },
148
149 /** @override */
150 getRegulatoryInfo: function() {
151 return cr.sendWithPromise('getRegulatoryInfo');
152 }
153 </if>
154 };
155
156 return {
157 AboutPageBrowserProxy: AboutPageBrowserProxy,
158 AboutPageBrowserProxyImpl: AboutPageBrowserProxyImpl,
159 };
160 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698