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

Side by Side Diff: chrome/browser/extensions/extension_migrator.cc

Issue 1871713002: Convert //chrome/browser/extensions 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
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 "chrome/browser/extensions/extension_migrator.h" 5 #include "chrome/browser/extensions/extension_migrator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/defaults.h" 10 #include "chrome/browser/defaults.h"
(...skipping 11 matching lines...) Expand all
22 22
23 ExtensionMigrator::~ExtensionMigrator() { 23 ExtensionMigrator::~ExtensionMigrator() {
24 } 24 }
25 25
26 void ExtensionMigrator::StartLoading() { 26 void ExtensionMigrator::StartLoading() {
27 prefs_.reset(new base::DictionaryValue); 27 prefs_.reset(new base::DictionaryValue);
28 28
29 const bool should_have_extension = 29 const bool should_have_extension =
30 IsAppPresent(old_id_) || IsAppPresent(new_id_); 30 IsAppPresent(old_id_) || IsAppPresent(new_id_);
31 if (should_have_extension) { 31 if (should_have_extension) {
32 scoped_ptr<base::DictionaryValue> entry(new base::DictionaryValue); 32 std::unique_ptr<base::DictionaryValue> entry(new base::DictionaryValue);
33 entry->SetStringWithoutPathExpansion( 33 entry->SetStringWithoutPathExpansion(
34 ExternalProviderImpl::kExternalUpdateUrl, 34 ExternalProviderImpl::kExternalUpdateUrl,
35 extension_urls::GetWebstoreUpdateUrl().spec()); 35 extension_urls::GetWebstoreUpdateUrl().spec());
36 36
37 prefs_->SetWithoutPathExpansion(new_id_, std::move(entry)); 37 prefs_->SetWithoutPathExpansion(new_id_, std::move(entry));
38 } 38 }
39 39
40 LoadFinished(); 40 LoadFinished();
41 } 41 }
42 42
43 bool ExtensionMigrator::IsAppPresent(const std::string& app_id) { 43 bool ExtensionMigrator::IsAppPresent(const std::string& app_id) {
44 return !!ExtensionRegistry::Get(profile_)->GetInstalledExtension(app_id); 44 return !!ExtensionRegistry::Get(profile_)->GetInstalledExtension(app_id);
45 } 45 }
46 46
47 } // namespace extensions 47 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698