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

Unified Diff: chrome/browser/extensions/api/extension_action/extension_action_api.h

Issue 496403003: Remove NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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/extensions/api/extension_action/extension_action_api.h
diff --git a/chrome/browser/extensions/api/extension_action/extension_action_api.h b/chrome/browser/extensions/api/extension_action/extension_action_api.h
index ac29d1f786282b2c3bf8109ee37bdda65f991500..afd80bec59a974efd855deb0e19f3ffb1e55b924 100644
--- a/chrome/browser/extensions/api/extension_action/extension_action_api.h
+++ b/chrome/browser/extensions/api/extension_action/extension_action_api.h
@@ -44,7 +44,11 @@ class ExtensionActionAPI : public BrowserContextKeyedAPI {
virtual void OnExtensionActionUpdated(
ExtensionAction* extension_action,
content::WebContents* web_contents,
- content::BrowserContext* browser_context) = 0;
+ content::BrowserContext* browser_context) {}
+
+ // Called when the page actions have been refreshed do to a possible change
+ // in count or visibility.
+ virtual void OnPageActionsUpdated(content::WebContents* web_contents) {}
// Called when the ExtensionActionAPI is shutting down, giving observers a
// chance to unregister themselves if there is not a definitive lifecycle.
@@ -86,14 +90,19 @@ class ExtensionActionAPI : public BrowserContextKeyedAPI {
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
+ // Notifies that there has been a change in the given |extension_action|.
void NotifyChange(ExtensionAction* extension_action,
content::WebContents* web_contents,
content::BrowserContext* browser_context);
// Clears the values for all ExtensionActions for the tab associated with the
- // given |web_contents|.
+ // given |web_contents| (and signals that page actions changed).
void ClearAllValuesForTab(content::WebContents* web_contents);
+ // Notifies that the current set of page actions for |web_contents| has
+ // changed, and signals the browser to update.
+ void NotifyPageActionsChanged(content::WebContents* web_contents);
+
private:
friend class BrowserContextKeyedAPIFactory<ExtensionActionAPI>;

Powered by Google App Engine
This is Rietveld 408576698