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

Unified Diff: chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc

Issue 2784653004: Cleanup Tool WebUI: Add HTML content and styling with dummy JS (Closed)
Patch Set: Port in review changes on now-deleted main.html to cleanup.html 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/ui/webui/cleanup_tool/cleanup_action_handler.cc
diff --git a/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc b/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..51c4e04dea3fa49de8e19d5b2da8a013576eca27
--- /dev/null
+++ b/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc
@@ -0,0 +1,29 @@
+// 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.
+
+#include "chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h"
+
+#include "base/bind.h"
+#include "base/values.h"
+#include "chrome/grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+CleanupActionHandler::CleanupActionHandler() {}
+
+void CleanupActionHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "requestLastScanResult",
+ base::Bind(&CleanupActionHandler::HandleRequestLastScanResult,
+ base::Unretained(this)));
+}
+
+void CleanupActionHandler::HandleRequestLastScanResult(
+ const base::ListValue* args) {
+ // TODO(proberge): Return real information about the last run.
+ // TODO(proberge): Localize strings once they are finalized.
+ web_ui()->CallJavascriptFunctionUnsafe("cleanup.Manager.setDetectionStatus",
+ base::Value(false), base::Value(false),
+ base::Value("No problems detected"),
+ base::Value("Last scanned today"));
+}

Powered by Google App Engine
This is Rietveld 408576698