diff options
author | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 18:20:31 +0000 |
---|---|---|
committer | rafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 18:20:31 +0000 |
commit | 01f829ab3cc802b79942f5a988f6a72e7a2b594d (patch) | |
tree | 8d5566ebfa133239e7947cac02b685df95d5b66f /chrome/browser/views/browser_actions_container.h | |
parent | 5715c63e814adcf7d0515ea08c16955d49615a33 (diff) | |
download | chromium_src-01f829ab3cc802b79942f5a988f6a72e7a2b594d.zip chromium_src-01f829ab3cc802b79942f5a988f6a72e7a2b594d.tar.gz chromium_src-01f829ab3cc802b79942f5a988f6a72e7a2b594d.tar.bz2 |
Initial support for inspecting extension popups.
The primary change in this CL is a refactor which makes ExtensionPopup a bit more self-contained WRT its clients. It adds the ability to specify an "inspect_with_devtools" flag to its Show() method which will cause the popup to remain open regardless of losing focus and to focus a devtools window on the popup's render view host.
This CL also pulls apart some aspects of the extension_popup_api from ExtensionFunctionDispatcher and ExtensionHost.
Still remaining to be done are:
1) Also the popup to stay open when the host window drags (it current closes)
2) Support for GTK
3) Support for Mac
BUG=24477
Review URL: http://codereview.chromium.org/1001002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/browser_actions_container.h')
-rw-r--r-- | chrome/browser/views/browser_actions_container.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/chrome/browser/views/browser_actions_container.h b/chrome/browser/views/browser_actions_container.h index 1452358..bd25f897 100644 --- a/chrome/browser/views/browser_actions_container.h +++ b/chrome/browser/views/browser_actions_container.h @@ -11,11 +11,13 @@ #include "app/slide_animation.h" #include "base/task.h" +#include "chrome/browser/extensions/extension_action_context_menu_model.h" #include "chrome/browser/extensions/extension_toolbar_model.h" #include "chrome/browser/extensions/image_loading_tracker.h" #include "chrome/browser/views/browser_bubble.h" #include "chrome/browser/views/extensions/browser_action_overflow_menu_controller.h" #include "chrome/browser/views/extensions/extension_action_context_menu.h" +#include "chrome/browser/views/extensions/extension_popup.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "views/controls/button/menu_button.h" @@ -225,14 +227,15 @@ class BrowserActionView : public views::View { //////////////////////////////////////////////////////////////////////////////// class BrowserActionsContainer : public views::View, - public NotificationObserver, - public BrowserBubble::Delegate, public views::ViewMenuDelegate, public views::DragController, public views::ResizeGripper::ResizeGripperDelegate, public AnimationDelegate, public ExtensionToolbarModel::Observer, - public BrowserActionOverflowMenuController::Observer { + public BrowserActionOverflowMenuController::Observer, + public ExtensionActionContextMenuModel::MenuDelegate, + public ExtensionPopup::Observer { + friend class ShowFolderMenuTask; public: BrowserActionsContainer(Browser* browser, views::View* owner_view); @@ -284,7 +287,8 @@ class BrowserActionsContainer size_t VisibleBrowserActions() const; // Called when the user clicks on the browser action icon. - void OnBrowserActionExecuted(BrowserActionButton* button); + void OnBrowserActionExecuted(BrowserActionButton* button, + bool inspect_with_devtools); // Overridden from views::View: virtual gfx::Size GetPreferredSize(); @@ -302,17 +306,6 @@ class BrowserActionsContainer virtual void OnDragExited(); virtual int OnPerformDrop(const views::DropTargetEvent& event); - // Overridden from NotificationObserver: - virtual void Observe(NotificationType type, - const NotificationSource& source, - const NotificationDetails& details); - - // BrowserBubble::Delegate methods. - virtual void BubbleBrowserWindowMoved(BrowserBubble* bubble); - virtual void BubbleBrowserWindowClosing(BrowserBubble* bubble); - virtual void BubbleGotFocus(BrowserBubble* bubble); - virtual void BubbleLostFocus(BrowserBubble* bubble, bool lost_focus_to_child); - // Overridden from views::ViewMenuDelegate: virtual void RunMenu(View* source, const gfx::Point& pt); @@ -336,6 +329,13 @@ class BrowserActionsContainer virtual void NotifyMenuDeleted( BrowserActionOverflowMenuController* controller); + // Overridden from ExtensionActionContextMenuModel::MenuDelegate + virtual void ShowPopupForDevToolsWindow(Extension* extension, + ExtensionAction* extension_action); + + // Overriden from ExtensionPopup::Delegate + virtual void ExtensionPopupClosed(ExtensionPopup* popup); + // Moves a browser action with |id| to |new_index|. void MoveBrowserAction(const std::string& extension_id, size_t new_index); @@ -418,8 +418,6 @@ class BrowserActionsContainer // this collection. Some extensions may be disabled in incognito windows. BrowserActionViews browser_action_views_; - NotificationRegistrar registrar_; - Profile* profile_; // The Browser object the container is associated with. |