diff options
author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 04:47:42 +0000 |
---|---|---|
committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-17 04:47:42 +0000 |
commit | 3012d7fc86d0bd218469817167f0b8d706092de7 (patch) | |
tree | b156a3247b7a4ba74a6496b3d426aeafac3c075e /chrome/browser/extensions/extension_tab_helper.h | |
parent | e7293fa923c53d7e5ea3d38a0b94d6cbc0fb8486 (diff) | |
download | chromium_src-3012d7fc86d0bd218469817167f0b8d706092de7.zip chromium_src-3012d7fc86d0bd218469817167f0b8d706092de7.tar.gz chromium_src-3012d7fc86d0bd218469817167f0b8d706092de7.tar.bz2 |
Only return the visible page actions from PageActionController.
This is a bit of a yak shave to support having the "action box" show active
extensions on the current page rather than page actions. Previously,
PageActionController was creating widgets for everything then
LocationBarViewGtk was hiding them as necessary. This is assumes too much; we
need to push the visibility logic into the Controller for the future.
BUG=127988
Review URL: https://chromiumcodereview.appspot.com/10388160
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_tab_helper.h')
-rw-r--r-- | chrome/browser/extensions/extension_tab_helper.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_tab_helper.h b/chrome/browser/extensions/extension_tab_helper.h index 16b4f5f..c095082 100644 --- a/chrome/browser/extensions/extension_tab_helper.h +++ b/chrome/browser/extensions/extension_tab_helper.h @@ -7,6 +7,7 @@ #pragma once #include "base/memory/weak_ptr.h" +#include "base/observer_list.h" #include "chrome/browser/extensions/app_notify_channel_setup.h" #include "chrome/browser/extensions/extension_function_dispatcher.h" #include "chrome/browser/extensions/image_loading_tracker.h" @@ -24,6 +25,11 @@ namespace content { struct LoadCommittedDetails; } +namespace extensions { +class ActionBoxController; +class ScriptExecutor; +} + // Per-tab extension helper. Also handles non-extension apps. class ExtensionTabHelper : public content::WebContentsObserver, @@ -33,6 +39,15 @@ class ExtensionTabHelper public AppNotifyChannelSetup::Delegate, public base::SupportsWeakPtr<ExtensionTabHelper> { public: + class Observer { + public: + // Called when the page action state (such as visibility, title) changes. + virtual void OnPageActionStateChanged() = 0; + + protected: + virtual ~Observer() {} + }; + explicit ExtensionTabHelper(TabContentsWrapper* wrapper); virtual ~ExtensionTabHelper(); @@ -50,6 +65,10 @@ class ExtensionTabHelper // the data is available. void GetApplicationInfo(int32 page_id); + // Observer management. + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + // App extensions ------------------------------------------------------------ // Sets the extension denoting this as an app. If |extension| is non-null this @@ -90,6 +109,14 @@ class ExtensionTabHelper return content::WebContentsObserver::web_contents(); } + extensions::ScriptExecutor* script_executor() { + return script_executor_.get(); + } + + extensions::ActionBoxController* action_box_controller() { + return action_box_controller_.get(); + } + // Sets a non-extension app icon associated with WebContents and fires an // INVALIDATE_TYPE_TITLE navigation state change to trigger repaint of title. void SetAppIcon(const SkBitmap& app_icon); @@ -172,6 +199,12 @@ class ExtensionTabHelper TabContentsWrapper* wrapper_; + scoped_ptr<extensions::ScriptExecutor> script_executor_; + + scoped_ptr<extensions::ActionBoxController> action_box_controller_; + + ObserverList<Observer> observers_; + DISALLOW_COPY_AND_ASSIGN(ExtensionTabHelper); }; |