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

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

Issue 2789663003: Cleanup Tool WebUI: Add browser_proxy javascript class (Closed)
Patch Set: Created 3 years, 9 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..9d5d71133eac97b3c6366c7661de9789f06659a1
--- /dev/null
+++ b/chrome/browser/resources/cleanup_tool/cleanup_browser_proxy.js
@@ -0,0 +1,53 @@
+// 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 Whether there are existing scan results.
+ * isInfected: boolean Whether the last scan found a program that the Chrome
+ * Cleanup Tool can remove,
Fabio Tirelo 2017/03/30 19:25:45 Nit: period at the end of each item?
+ * detectionStatusText: string A pluralized and localized string summarizing
+ * the scan results,
+ * detectionTimeText: string A pluralized and localized string summarizing
+ * when the last scan took place
+ * }};
+ */
+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