| 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"));
|
| +}
|
|
|