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

Unified Diff: components/proximity_auth/screenlock_bridge.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 7 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: components/proximity_auth/screenlock_bridge.cc
diff --git a/components/proximity_auth/screenlock_bridge.cc b/components/proximity_auth/screenlock_bridge.cc
index e5ca4f2545bb98a9d36e82ad4d589dd60d2c5bc6..891c9d1675f9718cd3055d9fdf5ec53e087c3275 100644
--- a/components/proximity_auth/screenlock_bridge.cc
+++ b/components/proximity_auth/screenlock_bridge.cc
@@ -4,6 +4,9 @@
#include "components/proximity_auth/screenlock_bridge.h"
+#include <utility>
+
+#include "base/memory/ptr_util.h"
#include "base/strings/string16.h"
#include "build/build_config.h"
#include "components/proximity_auth/logging/logging.h"
@@ -63,15 +66,15 @@ ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() {
std::unique_ptr<base::DictionaryValue>
ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const {
- std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
+ auto result = base::MakeUnique<base::DictionaryValue>();
std::string icon_id = GetIdForIcon(icon_);
result->SetString("id", icon_id);
if (!tooltip_.empty()) {
- base::DictionaryValue* tooltip_options = new base::DictionaryValue();
+ auto tooltip_options = base::MakeUnique<base::DictionaryValue>();
tooltip_options->SetString("text", tooltip_);
tooltip_options->SetBoolean("autoshow", autoshow_tooltip_);
- result->Set("tooltip", tooltip_options);
+ result->Set("tooltip", std::move(tooltip_options));
}
if (!aria_label_.empty())

Powered by Google App Engine
This is Rietveld 408576698