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

Unified Diff: chrome/browser/extensions/extension_toolbar_model.h

Issue 25305002: Implement initial chrome.browserAction.openPopup API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: please review Created 7 years, 2 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/extension_toolbar_model.h
diff --git a/chrome/browser/extensions/extension_toolbar_model.h b/chrome/browser/extensions/extension_toolbar_model.h
index df01de5d17281de69b7072048f8efca77b573e26..403c581b014c0a04477772951b5a01607754fc93 100644
--- a/chrome/browser/extensions/extension_toolbar_model.h
+++ b/chrome/browser/extensions/extension_toolbar_model.h
@@ -48,6 +48,10 @@ class ExtensionToolbarModel : public content::NotificationObserver {
virtual void BrowserActionMoved(const extensions::Extension* extension,
int index) {}
+ // The browser action should show the popup now.
+ virtual void BrowserActionShowPopup(
+ const extensions::Extension* extension) {}
mark a. foltz 2013/10/11 20:25:30 unwrap line
justinlin 2013/10/16 07:06:48 Done.
+
// Called when the model has finished loading.
virtual void ModelLoaded() {}
@@ -59,6 +63,7 @@ class ExtensionToolbarModel : public content::NotificationObserver {
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
void MoveBrowserAction(const extensions::Extension* extension, int index);
+ void ShowBrowserActionPopup(const extensions::Extension* extension);
mark a. foltz 2013/10/11 20:25:30 How different from BrowserActionShowPopup? Is thi
justinlin 2013/10/16 07:06:48 It's a method on the model to send a notification
// 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
@@ -66,6 +71,9 @@ class ExtensionToolbarModel : public content::NotificationObserver {
Action ExecuteBrowserAction(const extensions::Extension* extension,
Browser* browser,
GURL* popup_url_out);
+ // Retrieves the URL that should be loaded in the popup for an extension
+ // without granting host permissions for the tab. Used for the showPopup API.
+ GURL GetPopupUrl(const extensions::Extension* extension, Browser* browser);
// If count == size(), this will set the visible icon count to -1, meaning
// "show all actions".
void SetVisibleIconCount(int count);

Powered by Google App Engine
This is Rietveld 408576698