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

Side by Side Diff: chrome/browser/profile_resetter/resettable_settings_snapshot.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chrome/browser/profile_resetter/resettable_settings_snapshot.h" 5 #include "chrome/browser/profile_resetter/resettable_settings_snapshot.h"
6 6
7 #include <memory>
8 #include <utility>
9
7 #include "base/guid.h" 10 #include "base/guid.h"
8 #include "base/md5.h" 11 #include "base/md5.h"
9 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
11 #include "base/synchronization/cancellation_flag.h" 14 #include "base/synchronization/cancellation_flag.h"
12 #include "base/values.h" 15 #include "base/values.h"
13 #include "chrome/browser/browser_process.h" 16 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/profile_resetter/profile_reset_report.pb.h" 17 #include "chrome/browser/profile_resetter/profile_reset_report.pb.h"
15 #include "chrome/browser/profile_resetter/reset_report_uploader.h" 18 #include "chrome/browser/profile_resetter/reset_report_uploader.h"
16 #include "chrome/browser/profile_resetter/reset_report_uploader_factory.h" 19 #include "chrome/browser/profile_resetter/reset_report_uploader_factory.h"
(...skipping 11 matching lines...) Expand all
28 #include "extensions/browser/extension_registry.h" 31 #include "extensions/browser/extension_registry.h"
29 #include "grit/components_strings.h" 32 #include "grit/components_strings.h"
30 #include "ui/base/l10n/l10n_util.h" 33 #include "ui/base/l10n/l10n_util.h"
31 34
32 namespace { 35 namespace {
33 36
34 template <class StringType> 37 template <class StringType>
35 void AddPair(base::ListValue* list, 38 void AddPair(base::ListValue* list,
36 const base::string16& key, 39 const base::string16& key,
37 const StringType& value) { 40 const StringType& value) {
38 base::DictionaryValue* results = new base::DictionaryValue(); 41 std::unique_ptr<base::DictionaryValue> results(new base::DictionaryValue());
39 results->SetString("key", key); 42 results->SetString("key", key);
40 results->SetString("value", value); 43 results->SetString("value", value);
41 list->Append(results); 44 list->Append(std::move(results));
42 } 45 }
43 46
44 } // namespace 47 } // namespace
45 48
46 ResettableSettingsSnapshot::ResettableSettingsSnapshot( 49 ResettableSettingsSnapshot::ResettableSettingsSnapshot(
47 Profile* profile) 50 Profile* profile)
48 : startup_(SessionStartupPref::GetStartupPref(profile)), 51 : startup_(SessionStartupPref::GetStartupPref(profile)),
49 shortcuts_determined_(false), 52 shortcuts_determined_(false),
50 weak_ptr_factory_(this) { 53 weak_ptr_factory_(this) {
51 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 54 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 extension_names += '\n'; 330 extension_names += '\n';
328 extension_names += i->second; 331 extension_names += i->second;
329 } 332 }
330 if (!extension_names.empty()) { 333 if (!extension_names.empty()) {
331 AddPair(list.get(), 334 AddPair(list.get(),
332 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS), 335 l10n_util::GetStringUTF16(IDS_RESET_PROFILE_SETTINGS_EXTENSIONS),
333 extension_names); 336 extension_names);
334 } 337 }
335 return list; 338 return list;
336 } 339 }
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_history.cc ('k') | chrome/browser/speech/extension_api/tts_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698