Index: chrome/browser/resources/settings/android_apps_page/android_apps_browser_proxy.js |
diff --git a/chrome/browser/resources/settings/android_apps_page/android_apps_browser_proxy.js b/chrome/browser/resources/settings/android_apps_page/android_apps_browser_proxy.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0a2970f266ea056ef3070ff08f97c68356b3f9c3 |
--- /dev/null |
+++ b/chrome/browser/resources/settings/android_apps_page/android_apps_browser_proxy.js |
@@ -0,0 +1,54 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+/** |
+ * @fileoverview A helper object used by the "Google Play Store" (Arc++) section |
+ * to retrieve information about android apps. |
+ */ |
+ |
+/** |
+ * @typedef {{appReady: boolean}} |
+ * @see chrome/browser/ui/webui/settings/chromeos/android_apps_handler.cc |
+ */ |
+var AndroidAppsInfo; |
+ |
+cr.define('settings', function() { |
+ /** @interface */ |
+ function AndroidAppsBrowserProxy() { |
michaelpg
2016/12/01 20:15:34
opt nit: } on same line
stevenjb
2016/12/02 00:39:19
I got pushback from other reviewers for doing that
|
+ } |
+ |
+ AndroidAppsBrowserProxy.prototype = { |
+ /** @return {!Promise<!AndroidAppsInfo>} */ |
+ getAndroidAppsInfo: function() {}, |
+ |
+ showAndroidAppsSettings: function() {}, |
+ }; |
+ |
+ /** |
+ * @constructor |
+ * @implements {settings.AndroidAppsBrowserProxy} |
+ */ |
+ function AndroidAppsBrowserProxyImpl() { |
michaelpg
2016/12/01 20:15:34
same nit, also add a blank line between this and t
stevenjb
2016/12/02 00:39:19
Done.
|
+ } |
+ // The singleton instance_ can be replaced with a test version of this wrapper |
+ // during testing. |
+ cr.addSingletonGetter(AndroidAppsBrowserProxyImpl); |
+ |
+ AndroidAppsBrowserProxyImpl.prototype = { |
+ /** @override */ |
+ getAndroidAppsInfo: function() { |
+ return cr.sendWithPromise('getAndroidAppsInfo'); |
+ }, |
+ |
+ /** @override */ |
+ showAndroidAppsSettings: function() { |
+ chrome.send('showAndroidAppsSettings'); |
+ }, |
+ }; |
+ |
+ return { |
+ AndroidAppsBrowserProxy: AndroidAppsBrowserProxy, |
+ AndroidAppsBrowserProxyImpl: AndroidAppsBrowserProxyImpl, |
+ }; |
+}); |