Index: chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js |
diff --git a/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js b/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6d3939879d4e6404bdbee1adac43c916e496f890 |
--- /dev/null |
+++ b/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js |
@@ -0,0 +1,50 @@ |
+// Copyright 2017 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 Helper object and related behavior that encapsulate messaging |
+ * between JS and C++ for interacting with the Chrome Cleanup Tool. |
+ */ |
+ |
+/** |
+ * @typedef {{ |
+ * hasScanResults: boolean, |
+ * isInfected: boolean, |
+ * detectionStatusText: string, |
+ * detectionTimeText: string, |
+ * }}; |
Dan Beam
2017/04/05 19:41:26
}}; -> }}
|
+ */ |
+var LastScanResult; |
+ |
+cr.define('cleanup', function() { |
+ /** @interface */ |
+ function CleanupBrowserProxy() {} |
+ |
+ CleanupBrowserProxy.prototype = { |
+ /** |
+ * Fetch the result of the latest Chrome Cleanup Tool scanning task. |
+ * @return {!Promise<LastScanResult>} |
+ */ |
+ requestLastScanResult: function() {}, |
+ }; |
+ |
+ /** |
+ * @constructor |
+ * @implements {cleanup.CleanupBrowserProxy} |
+ */ |
+ function CleanupBrowserProxyImpl() {} |
+ cr.addSingletonGetter(CleanupBrowserProxyImpl); |
+ |
+ CleanupBrowserProxyImpl.prototype = { |
+ /** @override */ |
+ requestLastScanResult: function() { |
+ return cr.sendWithPromise('requestLastScanResult'); |
+ }, |
+ }; |
+ |
+ return { |
+ CleanupBrowserProxy: CleanupBrowserProxy, |
+ CleanupBrowserProxyImpl: CleanupBrowserProxyImpl, |
+ } |
+}); |