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

Side by Side Diff: chrome/browser/extensions/api/preference/preference_helpers.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: Rebase and fix header 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/api/preference/preference_helpers.h" 5 #include "chrome/browser/extensions/api/preference/preference_helpers.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 if (incognito && util::IsIncognitoEnabled(extension->id(), profile)) { 120 if (incognito && util::IsIncognitoEnabled(extension->id(), profile)) {
121 restrict_to_profile = profile->GetOffTheRecordProfile(); 121 restrict_to_profile = profile->GetOffTheRecordProfile();
122 } else if (!incognito && 122 } else if (!incognito &&
123 PreferenceAPI::Get(profile)->DoesExtensionControlPref( 123 PreferenceAPI::Get(profile)->DoesExtensionControlPref(
124 extension->id(), browser_pref, &from_incognito) && 124 extension->id(), browser_pref, &from_incognito) &&
125 from_incognito) { 125 from_incognito) {
126 restrict_to_profile = profile; 126 restrict_to_profile = profile;
127 } 127 }
128 } 128 }
129 129
130 scoped_ptr<base::ListValue> args_copy(args->DeepCopy()); 130 std::unique_ptr<base::ListValue> args_copy(args->DeepCopy());
131 scoped_ptr<Event> event( 131 std::unique_ptr<Event> event(
132 new Event(histogram_value, event_name, std::move(args_copy))); 132 new Event(histogram_value, event_name, std::move(args_copy)));
133 event->restrict_to_browser_context = restrict_to_profile; 133 event->restrict_to_browser_context = restrict_to_profile;
134 router->DispatchEventToExtension(extension->id(), std::move(event)); 134 router->DispatchEventToExtension(extension->id(), std::move(event));
135 } 135 }
136 } 136 }
137 } 137 }
138 138
139 } // namespace preference_helpers 139 } // namespace preference_helpers
140 } // namespace extensions 140 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698