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

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: Move build include to is_win section 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/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..1a84b1aebcf12e1a89f46067f1b4f0e15f51f126
--- /dev/null
+++ b/chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.cc
@@ -0,0 +1,38 @@
+// 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"
+
+CleanupActionHandler::CleanupActionHandler() {}
+
+CleanupActionHandler::~CleanupActionHandler() {}
+
+void CleanupActionHandler::RegisterMessages() {
+ web_ui()->RegisterMessageCallback(
+ "requestLastScanResult",
+ base::Bind(&CleanupActionHandler::HandleRequestLastScanResult,
+ base::Unretained(this)));
+}
+
+void CleanupActionHandler::HandleRequestLastScanResult(
+ const base::ListValue* args) {
+ std::string webui_callback_id;
+ CHECK_EQ(1U, args->GetSize());
+ bool success = args->GetString(0, &webui_callback_id);
+ DCHECK(success);
+
+ base::DictionaryValue last_scan_results;
+ // TODO(proberge): Return real information about the last run.
+ // TODO(proberge): Localize strings once they are finalized.
+ last_scan_results.SetBoolean("hasScanResults", false);
+ last_scan_results.SetBoolean("isInfected", false);
+ last_scan_results.SetString("detectionStatusText", "No problems detected");
+ last_scan_results.SetString("detectionTimeText", "Last scanned today");
+
+ AllowJavascript();
+ ResolveJavascriptCallback(base::Value(webui_callback_id), last_scan_results);
+}
« no previous file with comments | « chrome/browser/ui/webui/cleanup_tool/cleanup_action_handler.h ('k') | chrome/browser/ui/webui/cleanup_tool/cleanup_tool_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698