Chromium Code Reviews| Index: chrome/browser/extensions/extension_toolbar_model.h |
| diff --git a/chrome/browser/extensions/extension_toolbar_model.h b/chrome/browser/extensions/extension_toolbar_model.h |
| index df01de5d17281de69b7072048f8efca77b573e26..c7466b25b27dc501a115a420457076c92ff33bfb 100644 |
| --- a/chrome/browser/extensions/extension_toolbar_model.h |
| +++ b/chrome/browser/extensions/extension_toolbar_model.h |
| @@ -33,7 +33,7 @@ class ExtensionToolbarModel : public content::NotificationObserver { |
| }; |
| // A class which is informed of changes to the model; represents the view of |
| - // MVC. |
| + // MVC. Also used for signaling view changes such as showing extension popups. |
| class Observer { |
| public: |
| // An extension with a browser action button has been added, and should go |
| @@ -48,6 +48,10 @@ class ExtensionToolbarModel : public content::NotificationObserver { |
| virtual void BrowserActionMoved(const extensions::Extension* extension, |
| int index) {} |
| + // Signal the |extension| to show the popup now in the active window. |
| + // Returns true if a popup was slated to be shown. |
| + virtual bool BrowserActionShowPopup(const extensions::Extension* extension); |
| + |
| // Called when the model has finished loading. |
| virtual void ModelLoaded() {} |
| @@ -62,10 +66,13 @@ class ExtensionToolbarModel : public content::NotificationObserver { |
| // Executes the browser action for an extension and returns the action that |
| // the UI should perform in response. |
| // |popup_url_out| will be set if the extension should show a popup, with |
| - // the URL that should be shown, if non-NULL. |
| + // the URL that should be shown, if non-NULL. |should_grant| controls whether |
| + // the browser action should grant the page tab permissions, which is the case |
|
Finnur
2013/10/18 10:31:01
Suggest rewording: ... controls whether the extens
justinlin
2013/10/19 06:01:48
Done.
|
| + // for user clicks. The showPopup API does not grant permissions. |
| Action ExecuteBrowserAction(const extensions::Extension* extension, |
| Browser* browser, |
| - GURL* popup_url_out); |
| + GURL* popup_url_out, |
| + bool should_grant); |
| // If count == size(), this will set the visible icon count to -1, meaning |
| // "show all actions". |
| void SetVisibleIconCount(int count); |
| @@ -85,6 +92,10 @@ class ExtensionToolbarModel : public content::NotificationObserver { |
| void OnExtensionToolbarPrefChange(); |
| + // Tells observers to display a popup without granting tab permissions and |
| + // returns whether the popup was slated to be shown. |
| + bool ShowBrowserActionPopup(const extensions::Extension* extension); |
| + |
| private: |
| // content::NotificationObserver implementation. |
| virtual void Observe(int type, |