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

Side by Side Diff: components/proximity_auth/screenlock_bridge.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/proximity_auth/screenlock_bridge.h" 5 #include "components/proximity_auth/screenlock_bridge.h"
6 6
7 #include <utility>
8
9 #include "base/memory/ptr_util.h"
7 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
8 #include "build/build_config.h" 11 #include "build/build_config.h"
9 #include "components/proximity_auth/logging/logging.h" 12 #include "components/proximity_auth/logging/logging.h"
10 13
11 #if defined(OS_CHROMEOS) 14 #if defined(OS_CHROMEOS)
12 #include "chromeos/dbus/dbus_thread_manager.h" 15 #include "chromeos/dbus/dbus_thread_manager.h"
13 #include "chromeos/dbus/session_manager_client.h" 16 #include "chromeos/dbus/session_manager_client.h"
14 #endif 17 #endif
15 18
16 namespace proximity_auth { 19 namespace proximity_auth {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 : autoshow_tooltip_(false), 59 : autoshow_tooltip_(false),
57 hardlock_on_click_(false), 60 hardlock_on_click_(false),
58 is_trial_run_(false) { 61 is_trial_run_(false) {
59 } 62 }
60 63
61 ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() { 64 ScreenlockBridge::UserPodCustomIconOptions::~UserPodCustomIconOptions() {
62 } 65 }
63 66
64 std::unique_ptr<base::DictionaryValue> 67 std::unique_ptr<base::DictionaryValue>
65 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const { 68 ScreenlockBridge::UserPodCustomIconOptions::ToDictionaryValue() const {
66 std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue()); 69 auto result = base::MakeUnique<base::DictionaryValue>();
67 std::string icon_id = GetIdForIcon(icon_); 70 std::string icon_id = GetIdForIcon(icon_);
68 result->SetString("id", icon_id); 71 result->SetString("id", icon_id);
69 72
70 if (!tooltip_.empty()) { 73 if (!tooltip_.empty()) {
71 base::DictionaryValue* tooltip_options = new base::DictionaryValue(); 74 auto tooltip_options = base::MakeUnique<base::DictionaryValue>();
72 tooltip_options->SetString("text", tooltip_); 75 tooltip_options->SetString("text", tooltip_);
73 tooltip_options->SetBoolean("autoshow", autoshow_tooltip_); 76 tooltip_options->SetBoolean("autoshow", autoshow_tooltip_);
74 result->Set("tooltip", tooltip_options); 77 result->Set("tooltip", std::move(tooltip_options));
75 } 78 }
76 79
77 if (!aria_label_.empty()) 80 if (!aria_label_.empty())
78 result->SetString("ariaLabel", aria_label_); 81 result->SetString("ariaLabel", aria_label_);
79 82
80 if (hardlock_on_click_) 83 if (hardlock_on_click_)
81 result->SetBoolean("hardlockOnClick", true); 84 result->SetBoolean("hardlockOnClick", true);
82 85
83 if (is_trial_run_) 86 if (is_trial_run_)
84 result->SetBoolean("isTrialRun", true); 87 result->SetBoolean("isTrialRun", true);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 observers_.RemoveObserver(observer); 182 observers_.RemoveObserver(observer);
180 } 183 }
181 184
182 ScreenlockBridge::ScreenlockBridge() 185 ScreenlockBridge::ScreenlockBridge()
183 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {} 186 : lock_handler_(nullptr), focused_account_id_(EmptyAccountId()) {}
184 187
185 ScreenlockBridge::~ScreenlockBridge() { 188 ScreenlockBridge::~ScreenlockBridge() {
186 } 189 }
187 190
188 } // namespace proximity_auth 191 } // namespace proximity_auth
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698