Chromium Code Reviews| Index: chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
| diff --git a/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js b/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
| index 0f7ed4dbc8dfc6cc859e6ada503cfb3b4c3047db..bd0bbc49fcb94158b75b6a01075d54319aa3c2b1 100644 |
| --- a/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
| +++ b/chrome/browser/resources/settings/device_page/device_page_browser_proxy.js |
| @@ -33,6 +33,11 @@ settings.PowerSource; |
| */ |
| settings.BatteryStatus; |
| +/** |
| + * @typedef {{name:string, value:string, preferred:boolean}} |
| + */ |
| +var NoteAppInfo; |
|
stevenjb
2017/02/03 22:56:50
Prefer putting this into the settings namespace an
jdufault
2017/02/07 00:00:27
Done.
|
| + |
| cr.define('settings', function() { |
| /** @interface */ |
| function DevicePageBrowserProxy() {} |
| @@ -63,6 +68,26 @@ cr.define('settings', function() { |
| * battery (no external power source). |
| */ |
| setPowerSource: function(powerSourceId) {}, |
| + |
| + /** |
| + * |callback| is run when there is new note-taking app information |
| + * available or after |requestNoteTakingApps| has been called. |
| + * @param {function(Array<NoteAppInfo>, boolean):void} callback |
| + */ |
| + setNoteTakingAppsUpdatedCallback: function(callback) {}, |
| + |
| + /** |
| + * Request current note-taking app info. Invokes any callback registered in |
| + * |onNoteTakingAppsUpdated|. |
| + */ |
| + requestNoteTakingApps: function() {}, |
| + |
| + /** |
| + * Changes the preferred note taking app. |
| + * @param {string} appId The app id. This should be a value retrieved from a |
| + * |onNoteTakingAppsUpdated| callback. |
| + */ |
| + setPreferredNoteTakingApp: function(appId) {}, |
| }; |
| /** |
| @@ -105,6 +130,21 @@ cr.define('settings', function() { |
| setPowerSource: function(powerSourceId) { |
| chrome.send('setPowerSource', [powerSourceId]); |
| }, |
| + |
| + /** @override */ |
| + setNoteTakingAppsUpdatedCallback: function(callback) { |
| + cr.addWebUIListener('onNoteTakingAppsUpdated', callback); |
| + }, |
| + |
| + /** @override */ |
| + requestNoteTakingApps: function() { |
| + chrome.send('requestNoteTakingApps'); |
| + }, |
| + |
| + /** @override */ |
| + setPreferredNoteTakingApp: function(appId) { |
| + chrome.send('setPreferredNoteTakingApp', [appId]); |
| + }, |
| }; |
| return { |