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

Side by Side Diff: chrome/browser/extensions/extension_message_bubble_controller.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) 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/extensions/extension_message_bubble_controller.h" 5 #include "chrome/browser/extensions/extension_message_bubble_controller.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void ExtensionMessageBubbleController::AcknowledgeExtensions() { 237 void ExtensionMessageBubbleController::AcknowledgeExtensions() {
238 ExtensionIdList* list = GetOrCreateExtensionList(); 238 ExtensionIdList* list = GetOrCreateExtensionList();
239 for (ExtensionIdList::const_iterator it = list->begin(); 239 for (ExtensionIdList::const_iterator it = list->begin();
240 it != list->end(); ++it) 240 it != list->end(); ++it)
241 delegate_->AcknowledgeExtension(*it, user_action_); 241 delegate_->AcknowledgeExtension(*it, user_action_);
242 } 242 }
243 243
244 ExtensionIdList* ExtensionMessageBubbleController::GetOrCreateExtensionList() { 244 ExtensionIdList* ExtensionMessageBubbleController::GetOrCreateExtensionList() {
245 if (!initialized_) { 245 if (!initialized_) {
246 ExtensionRegistry* registry = ExtensionRegistry::Get(profile()); 246 ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
247 scoped_ptr<const ExtensionSet> all_extensions; 247 std::unique_ptr<const ExtensionSet> all_extensions;
248 if (!delegate_->ShouldLimitToEnabledExtensions()) 248 if (!delegate_->ShouldLimitToEnabledExtensions())
249 all_extensions = registry->GenerateInstalledExtensionsSet(); 249 all_extensions = registry->GenerateInstalledExtensionsSet();
250 const ExtensionSet& extensions_to_check = 250 const ExtensionSet& extensions_to_check =
251 all_extensions ? *all_extensions : registry->enabled_extensions(); 251 all_extensions ? *all_extensions : registry->enabled_extensions();
252 for (const scoped_refptr<const Extension>& extension : 252 for (const scoped_refptr<const Extension>& extension :
253 extensions_to_check) { 253 extensions_to_check) {
254 if (delegate_->ShouldIncludeExtension(extension.get())) 254 if (delegate_->ShouldIncludeExtension(extension.get()))
255 extension_list_.push_back(extension->id()); 255 extension_list_.push_back(extension->id());
256 } 256 }
257 257
(...skipping 17 matching lines...) Expand all
275 275
276 if (did_highlight_) 276 if (did_highlight_)
277 ToolbarActionsModel::Get(profile())->StopHighlighting(); 277 ToolbarActionsModel::Get(profile())->StopHighlighting();
278 } 278 }
279 279
280 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() { 280 std::set<Profile*>* ExtensionMessageBubbleController::GetProfileSet() {
281 return &g_shown_for_profiles.Get()[delegate_->GetKey()]; 281 return &g_shown_for_profiles.Get()[delegate_->GetKey()];
282 } 282 }
283 283
284 } // namespace extensions 284 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698