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

Unified Diff: chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js

Issue 2789663003: Cleanup Tool WebUI: Add browser_proxy javascript class (Closed)
Patch Set: Try make closure compiler happy Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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,
+ }
+});

Powered by Google App Engine
This is Rietveld 408576698