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

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

Issue 2257113002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_action_runner.h" 5 #include "chrome/browser/extensions/extension_action_runner.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 browser ? browser->window()->GetToolbarActionsBar() : nullptr; 350 browser ? browser->window()->GetToolbarActionsBar() : nullptr;
351 if (toolbar_actions_bar) { 351 if (toolbar_actions_bar) {
352 auto callback = 352 auto callback =
353 base::Bind(&ExtensionActionRunner::OnBlockedActionBubbleClosed, 353 base::Bind(&ExtensionActionRunner::OnBlockedActionBubbleClosed,
354 weak_factory_.GetWeakPtr(), extension->id()); 354 weak_factory_.GetWeakPtr(), extension->id());
355 if (default_bubble_close_action_for_testing_) { 355 if (default_bubble_close_action_for_testing_) {
356 base::ThreadTaskRunnerHandle::Get()->PostTask( 356 base::ThreadTaskRunnerHandle::Get()->PostTask(
357 FROM_HERE, 357 FROM_HERE,
358 base::Bind(callback, *default_bubble_close_action_for_testing_)); 358 base::Bind(callback, *default_bubble_close_action_for_testing_));
359 } else { 359 } else {
360 toolbar_actions_bar->ShowToolbarActionBubble(base::WrapUnique( 360 toolbar_actions_bar->ShowToolbarActionBubble(
361 new BlockedActionBubbleDelegate(callback, extension->id()))); 361 base::MakeUnique<BlockedActionBubbleDelegate>(callback,
362 extension->id()));
362 } 363 }
363 } 364 }
364 } 365 }
365 366
366 void ExtensionActionRunner::OnBlockedActionBubbleClosed( 367 void ExtensionActionRunner::OnBlockedActionBubbleClosed(
367 const std::string& extension_id, 368 const std::string& extension_id,
368 ToolbarActionsBarBubbleDelegate::CloseAction action) { 369 ToolbarActionsBarBubbleDelegate::CloseAction action) {
369 // If the user agreed to refresh the page, do so. 370 // If the user agreed to refresh the page, do so.
370 if (action == ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE) { 371 if (action == ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE) {
371 const Extension* extension = ExtensionRegistry::Get(browser_context_) 372 const Extension* extension = ExtensionRegistry::Get(browser_context_)
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 UnloadedExtensionInfo::Reason reason) { 420 UnloadedExtensionInfo::Reason reason) {
420 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); 421 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id());
421 if (iter != pending_scripts_.end()) { 422 if (iter != pending_scripts_.end()) {
422 pending_scripts_.erase(iter); 423 pending_scripts_.erase(iter);
423 ExtensionActionAPI::Get(browser_context_) 424 ExtensionActionAPI::Get(browser_context_)
424 ->NotifyPageActionsChanged(web_contents()); 425 ->NotifyPageActionsChanged(web_contents());
425 } 426 }
426 } 427 }
427 428
428 } // namespace extensions 429 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698