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

Side by Side Diff: components/user_manager/known_user.cc

Issue 1917673002: Convert //components/[u-z]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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
« no previous file with comments | « components/user_manager/fake_user_manager.h ('k') | components/user_manager/user.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/user_manager/known_user.h" 5 #include "components/user_manager/known_user.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory>
10
9 #include "base/logging.h" 11 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/values.h" 12 #include "base/values.h"
12 #include "components/prefs/pref_registry_simple.h" 13 #include "components/prefs/pref_registry_simple.h"
13 #include "components/prefs/scoped_user_pref_update.h" 14 #include "components/prefs/scoped_user_pref_update.h"
14 #include "components/user_manager/user_manager.h" 15 #include "components/user_manager/user_manager.h"
15 #include "google_apis/gaia/gaia_auth_util.h" 16 #include "google_apis/gaia/gaia_auth_util.h"
16 17
17 namespace user_manager { 18 namespace user_manager {
18 namespace known_user { 19 namespace known_user {
19 namespace { 20 namespace {
20 21
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (update->GetDictionary(i, &element)) { 127 if (update->GetDictionary(i, &element)) {
127 if (UserMatches(account_id, *element)) { 128 if (UserMatches(account_id, *element)) {
128 if (clear) 129 if (clear)
129 element->Clear(); 130 element->Clear();
130 element->MergeDictionary(&values); 131 element->MergeDictionary(&values);
131 UpdateIdentity(account_id, *element); 132 UpdateIdentity(account_id, *element);
132 return; 133 return;
133 } 134 }
134 } 135 }
135 } 136 }
136 scoped_ptr<base::DictionaryValue> new_value(new base::DictionaryValue()); 137 std::unique_ptr<base::DictionaryValue> new_value(new base::DictionaryValue());
137 new_value->MergeDictionary(&values); 138 new_value->MergeDictionary(&values);
138 UpdateIdentity(account_id, *new_value); 139 UpdateIdentity(account_id, *new_value);
139 update->Append(new_value.release()); 140 update->Append(new_value.release());
140 } 141 }
141 142
142 bool GetStringPref(const AccountId& account_id, 143 bool GetStringPref(const AccountId& account_id,
143 const std::string& path, 144 const std::string& path,
144 std::string* out_value) { 145 std::string* out_value) {
145 const base::DictionaryValue* user_pref_dict = nullptr; 146 const base::DictionaryValue* user_pref_dict = nullptr;
146 if (!FindPrefs(account_id, &user_pref_dict)) 147 if (!FindPrefs(account_id, &user_pref_dict))
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 375 }
375 } 376 }
376 } 377 }
377 378
378 void RegisterPrefs(PrefRegistrySimple* registry) { 379 void RegisterPrefs(PrefRegistrySimple* registry) {
379 registry->RegisterListPref(kKnownUsers); 380 registry->RegisterListPref(kKnownUsers);
380 } 381 }
381 382
382 } // namespace known_user 383 } // namespace known_user
383 } // namespace user_manager 384 } // namespace user_manager
OLDNEW
« no previous file with comments | « components/user_manager/fake_user_manager.h ('k') | components/user_manager/user.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698