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

Unified Diff: chrome/browser/ui/extensions/extension_action_view_controller.h

Issue 1105713002: [Extension Toolbar] Slide out overflowed actions for popups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/extension_action_view_controller.h
diff --git a/chrome/browser/ui/extensions/extension_action_view_controller.h b/chrome/browser/ui/extensions/extension_action_view_controller.h
index fbc67bc6c866d0407f77527b88e053430f2fc1aa..87117d9c0b351868ff7e28056a3ecc0dee0d17d8 100644
--- a/chrome/browser/ui/extensions/extension_action_view_controller.h
+++ b/chrome/browser/ui/extensions/extension_action_view_controller.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H_
#define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_ACTION_VIEW_CONTROLLER_H_
+#include "base/memory/weak_ptr.h"
#include "base/scoped_observer.h"
#include "chrome/browser/extensions/extension_action_icon_factory.h"
#include "chrome/browser/extensions/extension_context_menu_model.h"
@@ -75,6 +76,9 @@ class ExtensionActionViewController
// Closes the active popup (whether it was this action's popup or not).
void HideActivePopup();
+ // Handles cleanup after a menu closes.
+ void OnMenuClosed();
+
// Populates |command| with the command associated with |extension|, if one
// exists. Returns true if |command| was populated.
bool GetExtensionCommand(extensions::Command* command);
@@ -114,14 +118,21 @@ class ExtensionActionViewController
// e.g. an API). Returns true if a popup is shown.
bool ExecuteAction(PopupShowAction show_action, bool grant_tab_permissions);
- // Shows the popup for the extension action, given the associated |popup_url|.
- // |grant_tab_permissions| is true if active tab permissions should be given
- // to the extension; this is only true if the popup is opened through a user
- // action.
- // Returns true if a popup is successfully shown.
- bool ShowPopupWithUrl(PopupShowAction show_action,
- const GURL& popup_url,
- bool grant_tab_permissions);
+ // Begins the process of showing the popup for the extension action, given the
+ // associated |popup_url|. |grant_tab_permissions| is true if active tab
+ // permissions should be given to the extension; this is only true if the
+ // popup is opened through a user action.
+ // The popup may not be shown synchronously if the extension is hidden and
+ // first needs to slide itself out.
+ // Returns true if a popup will be shown.
+ bool TriggerPopupWithUrl(PopupShowAction show_action,
+ const GURL& popup_url,
+ bool grant_tab_permissions);
+
+ // Shows the popup with the given |host|.
+ void ShowPopup(scoped_ptr<extensions::ExtensionViewHost> host,
+ bool grant_tab_permissions,
+ PopupShowAction show_action);
// Handles cleanup after the popup closes.
void OnPopupClosed();
@@ -171,6 +182,8 @@ class ExtensionActionViewController
ScopedObserver<extensions::ExtensionHost, extensions::ExtensionHostObserver>
popup_host_observer_;
+ base::WeakPtrFactory<ExtensionActionViewController> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionActionViewController);
};

Powered by Google App Engine
This is Rietveld 408576698