| 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 by the "Google Play Store" (ARC) section | 6 * @fileoverview A helper object used by the "Google Play Store" (ARC) section |
| 7 * to retrieve information about android apps. | 7 * to retrieve information about android apps. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Type definition of AndroidAppsInfo entry. |playStoreEnabled| indicates that | 11 * Type definition of AndroidAppsInfo entry. |playStoreEnabled| indicates that |
| 12 * Play Store is enabled. |settingsAppAvailable| indicates that Android settings | 12 * Play Store is enabled. |settingsAppAvailable| indicates that Android settings |
| 13 * app is registered in the system. | 13 * app is registered in the system. |
| 14 * @typedef {{ | 14 * @typedef {{ |
| 15 * playStoreEnabled: boolean, | 15 * playStoreEnabled: boolean, |
| 16 * settingsAppAvailable: boolean, | 16 * settingsAppAvailable: boolean, |
| 17 * }} | 17 * }} |
| 18 * @see chrome/browser/ui/webui/settings/chromeos/android_apps_handler.cc | 18 * @see chrome/browser/ui/webui/settings/chromeos/android_apps_handler.cc |
| 19 */ | 19 */ |
| 20 var AndroidAppsInfo; | 20 var AndroidAppsInfo; |
| 21 | 21 |
| 22 cr.define('settings', function() { | 22 cr.define('settings', function() { |
| 23 /** @interface */ | 23 /** @interface */ |
| 24 function AndroidAppsBrowserProxy() { | 24 function AndroidAppsBrowserProxy() {} |
| 25 } | |
| 26 | 25 |
| 27 AndroidAppsBrowserProxy.prototype = { | 26 AndroidAppsBrowserProxy.prototype = { |
| 28 requestAndroidAppsInfo: function() {}, | 27 requestAndroidAppsInfo: function() {}, |
| 29 | 28 |
| 30 /** | 29 /** |
| 31 * @param {boolean} keyboardAction True if the app was opened using a | 30 * @param {boolean} keyboardAction True if the app was opened using a |
| 32 * keyboard action. | 31 * keyboard action. |
| 33 */ | 32 */ |
| 34 showAndroidAppsSettings: function(keyboardAction) {}, | 33 showAndroidAppsSettings: function(keyboardAction) {}, |
| 35 }; | 34 }; |
| 36 | 35 |
| 37 /** | 36 /** |
| 38 * @constructor | 37 * @constructor |
| 39 * @implements {settings.AndroidAppsBrowserProxy} | 38 * @implements {settings.AndroidAppsBrowserProxy} |
| 40 */ | 39 */ |
| 41 function AndroidAppsBrowserProxyImpl() { | 40 function AndroidAppsBrowserProxyImpl() {} |
| 42 } | |
| 43 | 41 |
| 44 // The singleton instance_ can be replaced with a test version of this wrapper | 42 // The singleton instance_ can be replaced with a test version of this wrapper |
| 45 // during testing. | 43 // during testing. |
| 46 cr.addSingletonGetter(AndroidAppsBrowserProxyImpl); | 44 cr.addSingletonGetter(AndroidAppsBrowserProxyImpl); |
| 47 | 45 |
| 48 AndroidAppsBrowserProxyImpl.prototype = { | 46 AndroidAppsBrowserProxyImpl.prototype = { |
| 49 /** @override */ | 47 /** @override */ |
| 50 requestAndroidAppsInfo: function() { | 48 requestAndroidAppsInfo: function() { |
| 51 chrome.send('requestAndroidAppsInfo'); | 49 chrome.send('requestAndroidAppsInfo'); |
| 52 }, | 50 }, |
| 53 | 51 |
| 54 /** @override */ | 52 /** @override */ |
| 55 showAndroidAppsSettings: function(keyboardAction) { | 53 showAndroidAppsSettings: function(keyboardAction) { |
| 56 chrome.send('showAndroidAppsSettings', [keyboardAction]); | 54 chrome.send('showAndroidAppsSettings', [keyboardAction]); |
| 57 }, | 55 }, |
| 58 }; | 56 }; |
| 59 | 57 |
| 60 return { | 58 return { |
| 61 AndroidAppsBrowserProxy: AndroidAppsBrowserProxy, | 59 AndroidAppsBrowserProxy: AndroidAppsBrowserProxy, |
| 62 AndroidAppsBrowserProxyImpl: AndroidAppsBrowserProxyImpl, | 60 AndroidAppsBrowserProxyImpl: AndroidAppsBrowserProxyImpl, |
| 63 }; | 61 }; |
| 64 }); | 62 }); |
| OLD | NEW |