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

Unified Diff: chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: headers Created 4 years, 2 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/options/chromeos/keyboard_handler.cc
diff --git a/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc b/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
index 104671e63b3e2473394e928769a292eafd3515ed..ac71a61233922028ad006ac8780a0bb63ab7268a 100644
--- a/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
@@ -6,6 +6,9 @@
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "ash/common/new_window_delegate.h"
#include "ash/common/wm_shell.h"
#include "base/bind.h"
@@ -140,11 +143,10 @@ void KeyboardHandler::GetLocalizedValues(
const input_method::ModifierKey value =
kModifierKeysSelectItems[j].value;
const int message_id = kModifierKeysSelectItems[j].message_id;
- base::ListValue* option = new base::ListValue();
- option->Append(new base::FundamentalValue(value));
- option->Append(new base::StringValue(l10n_util::GetStringUTF16(
- message_id)));
- list_value->Append(option);
+ std::unique_ptr<base::ListValue> option(new base::ListValue());
+ option->AppendInteger(value);
+ option->AppendString(l10n_util::GetStringUTF16(message_id));
+ list_value->Append(std::move(option));
}
localized_strings->Set(kDataValuesNames[i], list_value);
}

Powered by Google App Engine
This is Rietveld 408576698