Chromium Code Reviews| Index: chrome/browser/extensions/extension_action_runner.h |
| diff --git a/chrome/browser/extensions/extension_action_runner.h b/chrome/browser/extensions/extension_action_runner.h |
| index d985a28a56f74f1bdb1ec133ef7870e425d2c53e..e00592125d7516b992e303621f64fac4818b2280 100644 |
| --- a/chrome/browser/extensions/extension_action_runner.h |
| +++ b/chrome/browser/extensions/extension_action_runner.h |
| @@ -15,8 +15,10 @@ |
| #include "base/callback.h" |
| #include "base/compiler_specific.h" |
| #include "base/macros.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "base/scoped_observer.h" |
| #include "chrome/browser/extensions/extension_action.h" |
| +#include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "extensions/browser/blocked_action_type.h" |
| #include "extensions/browser/extension_registry_observer.h" |
| @@ -78,6 +80,11 @@ class ExtensionActionRunner : public content::WebContentsObserver, |
| int num_page_requests() const { return num_page_requests_; } |
| + void set_default_bubble_close_action_for_testing( |
| + scoped_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> action) { |
| + default_bubble_close_action_for_testing_ = std::move(action); |
| + } |
| + |
| #if defined(UNIT_TEST) |
| // Only used in tests. |
| PermissionsData::AccessType RequiresUserConsentForScriptInjectionForTesting( |
| @@ -141,6 +148,15 @@ class ExtensionActionRunner : public content::WebContentsObserver, |
| // Log metrics. |
| void LogUMA() const; |
| + // Shows the bubble to prompt the user to refresh the page to run the blocked |
| + // actions for the given |extension|. |
|
asargent_no_longer_on_chrome
2016/03/21 23:31:15
I could not help thinking of "the old lady who swa
Devlin
2016/03/23 21:48:46
heh hopefully it doesn't get any more complicated
|
| + void ShowBlockedActionBubble(const Extension* extension); |
| + |
| + // Called when the blocked actions bubble is closed. |
| + void OnBlockedActionBubbleClosed( |
| + const std::string& extension_id, |
| + ToolbarActionsBarBubbleDelegate::CloseAction action); |
| + |
| // content::WebContentsObserver implementation. |
| bool OnMessageReceived(const IPC::Message& message, |
| content::RenderFrameHost* render_frame_host) override; |
| @@ -177,9 +193,19 @@ class ExtensionActionRunner : public content::WebContentsObserver, |
| // should incorporate more fully with ActiveTab. |
| std::set<std::string> permitted_extensions_; |
| + // If true, ignore active tab being granted rather than running pending |
| + // actions. |
| + bool ignore_active_tab_granted_; |
| + |
| + // If non-null, the bubble action to simulate for testing. |
| + scoped_ptr<ToolbarActionsBarBubbleDelegate::CloseAction> |
| + default_bubble_close_action_for_testing_; |
| + |
| ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| extension_registry_observer_; |
| + base::WeakPtrFactory<ExtensionActionRunner> weak_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ExtensionActionRunner); |
| }; |