| OLD | NEW |
| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); | 348 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); |
| 349 ToolbarActionsBar* toolbar_actions_bar = | 349 ToolbarActionsBar* toolbar_actions_bar = |
| 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::BindOnce(callback, *default_bubble_close_action_for_testing_)); |
| 359 } else { | 359 } else { |
| 360 toolbar_actions_bar->ShowToolbarActionBubble( | 360 toolbar_actions_bar->ShowToolbarActionBubble( |
| 361 base::MakeUnique<BlockedActionBubbleDelegate>(callback, | 361 base::MakeUnique<BlockedActionBubbleDelegate>(callback, |
| 362 extension->id())); | 362 extension->id())); |
| 363 } | 363 } |
| 364 } | 364 } |
| 365 } | 365 } |
| 366 | 366 |
| 367 void ExtensionActionRunner::OnBlockedActionBubbleClosed( | 367 void ExtensionActionRunner::OnBlockedActionBubbleClosed( |
| 368 const std::string& extension_id, | 368 const std::string& extension_id, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 UnloadedExtensionInfo::Reason reason) { | 422 UnloadedExtensionInfo::Reason reason) { |
| 423 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); | 423 PendingScriptMap::iterator iter = pending_scripts_.find(extension->id()); |
| 424 if (iter != pending_scripts_.end()) { | 424 if (iter != pending_scripts_.end()) { |
| 425 pending_scripts_.erase(iter); | 425 pending_scripts_.erase(iter); |
| 426 ExtensionActionAPI::Get(browser_context_) | 426 ExtensionActionAPI::Get(browser_context_) |
| 427 ->NotifyPageActionsChanged(web_contents()); | 427 ->NotifyPageActionsChanged(web_contents()); |
| 428 } | 428 } |
| 429 } | 429 } |
| 430 | 430 |
| 431 } // namespace extensions | 431 } // namespace extensions |
| OLD | NEW |