summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/ui/webui/inspect_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/ui/webui/inspect_ui.cc')
-rw-r--r--chromium/chrome/browser/ui/webui/inspect_ui.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/chromium/chrome/browser/ui/webui/inspect_ui.cc b/chromium/chrome/browser/ui/webui/inspect_ui.cc
index 031cc220f5f..059c4d8bcb6 100644
--- a/chromium/chrome/browser/ui/webui/inspect_ui.cc
+++ b/chromium/chrome/browser/ui/webui/inspect_ui.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/webui/inspect_ui.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/macros.h"
#include "base/metrics/user_metrics.h"
@@ -69,14 +71,14 @@ const char kInspectUiNameField[] = "name";
const char kInspectUiUrlField[] = "url";
const char kInspectUiIsAdditionalField[] = "isAdditional";
-base::ListValue GetUiDevToolsTargets() {
- base::ListValue targets;
+base::Value GetUiDevToolsTargets() {
+ base::Value targets(base::Value::Type::LIST);
for (const auto& client_pair :
ui_devtools::UiDevToolsServer::GetClientNamesAndUrls()) {
- auto target_data = std::make_unique<base::DictionaryValue>();
- target_data->SetString(kInspectUiNameField, client_pair.first);
- target_data->SetString(kInspectUiUrlField, client_pair.second);
- target_data->SetBoolean(kInspectUiIsAdditionalField, true);
+ base::Value target_data(base::Value::Type::DICTIONARY);
+ target_data.SetStringKey(kInspectUiNameField, client_pair.first);
+ target_data.SetStringKey(kInspectUiUrlField, client_pair.second);
+ target_data.SetBoolKey(kInspectUiIsAdditionalField, true);
targets.Append(std::move(target_data));
}
return targets;
@@ -513,8 +515,7 @@ void InspectUI::StartListeningNotifications() {
DevToolsTargetsUIHandler::Callback callback =
base::Bind(&InspectUI::PopulateTargets, base::Unretained(this));
- base::ListValue additional_targets = GetUiDevToolsTargets();
- PopulateAdditionalTargets(additional_targets);
+ PopulateAdditionalTargets(GetUiDevToolsTargets());
AddTargetUIHandler(
DevToolsTargetsUIHandler::CreateForLocal(callback, profile));
@@ -666,7 +667,7 @@ void InspectUI::PopulateTargets(const std::string& source,
targets);
}
-void InspectUI::PopulateAdditionalTargets(const base::ListValue& targets) {
+void InspectUI::PopulateAdditionalTargets(const base::Value& targets) {
web_ui()->CallJavascriptFunctionUnsafe("populateAdditionalTargets", targets);
}