diff options
author | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 21:53:46 +0000 |
---|---|---|
committer | mpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 21:53:46 +0000 |
commit | 744ef17706b3c77d087809ec119bbc2f7bd17c89 (patch) | |
tree | 24eb889c256f49dd3d24610b68c5e09b90a5c21d /chrome/browser/tab_contents/tab_contents.h | |
parent | 0db22afeba278540d2457ebfead171a8a54feb3c (diff) | |
download | chromium_src-744ef17706b3c77d087809ec119bbc2f7bd17c89.zip chromium_src-744ef17706b3c77d087809ec119bbc2f7bd17c89.tar.gz chromium_src-744ef17706b3c77d087809ec119bbc2f7bd17c89.tar.bz2 |
Implement new page action API.
Still no actual drawing code for badges, though.
BUG=24635
TEST=Load the sample test_page_action extension and click the page action to cycle through various states.
Review URL: http://codereview.chromium.org/269079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29335 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/tab_contents.h')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index 99db09c..47b4243 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -269,6 +269,16 @@ class TabContents : public PageNavigator, const ExtensionActionState* GetPageActionState( const ExtensionAction* page_action); + // Same as above, but creates an enable state if it doesn't exist. The return + // value can be updated. The caller should call PageActionStateChanged when + // done modifying the state. + ExtensionActionState* GetOrCreatePageActionState( + const ExtensionAction* page_action); + + // Call this after updating a ExtensionActionState object returned by + // GetOrCreatePageActionState to notify clients about the changes. + void PageActionStateChanged(); + // Whether the tab is in the process of being destroyed. // Added as a tentative work-around for focus related bug #4633. This allows // us not to store focus when a tab is being closed. @@ -1111,12 +1121,13 @@ class TabContents : public PageNavigator, // Data for Page Actions ----------------------------------------------------- - // A map of page actions that are enabled in this tab (and a state object - // that can be used to override the title and icon used for the page action). - // This map is cleared every time the mainframe navigates and populated by the - // PageAction extension API. - std::map< const ExtensionAction*, linked_ptr<ExtensionActionState> > - enabled_page_actions_; + // A map of page actions that this tab knows about (and a state object that + // can be used to update the title, icon, visibilty, etc used for the page + // action). This map is cleared every time the mainframe navigates and + // populated by the PageAction extension API. + typedef std::map< const ExtensionAction*, linked_ptr<ExtensionActionState> > + PageActionStateMap; + PageActionStateMap page_actions_; // Data for misc internal state ---------------------------------------------- |