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

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: MakeUnique 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..44065df7fa060a83f73824156421e0b389636e3d 100644
--- a/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/keyboard_handler.cc
@@ -6,12 +6,16 @@
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "ash/common/new_window_delegate.h"
#include "ash/common/wm_shell.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/chromeos_switches.h"
@@ -140,11 +144,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);
+ auto option = base::MakeUnique<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