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

Unified Diff: chrome/browser/ui/views/browser_actions_container.cc

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/ui/views/browser_actions_container.cc
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc
index 7e011b528ecede14f5da0faca42f21f33016f334..c3de266fcb402000cb34cb4cc894407381af8cf1 100644
--- a/chrome/browser/ui/views/browser_actions_container.cc
+++ b/chrome/browser/ui/views/browser_actions_container.cc
@@ -686,6 +686,20 @@ void BrowserActionsContainer::BrowserActionMoved(const Extension* extension,
SchedulePaint();
}
+void BrowserActionsContainer::BrowserActionShowPopup(
+ const extensions::Extension* extension) {
+ // DO_NOT_REVIEW: This is not completely correct yet.
+ BrowserActionButton* button = NULL;
+ for (BrowserActionViews::iterator it = browser_action_views_.begin();
+ it != browser_action_views_.end(); ++it) {
+ if ((*it)->button()->extension() == extension) {
+ button = (*it)->button();
+ }
+ }
+ if (button != NULL)
+ ShowPopup(button, ExtensionPopup::SHOW);
+}
+
void BrowserActionsContainer::ModelLoaded() {
SetContainerWidth();
}
@@ -815,7 +829,7 @@ bool BrowserActionsContainer::ShouldDisplayBrowserAction(
void BrowserActionsContainer::ShowPopup(
BrowserActionButton* button,
ExtensionPopup::ShowAction show_action) {
- const Extension* extension = button->extension();
+ const extensions::Extension* extension = button->extension();
Matt Perry 2013/10/11 22:22:53 Why add this?
justinlin 2013/10/16 07:06:48 Done.
GURL popup_url;
if (model_->ExecuteBrowserAction(extension, browser_, &popup_url) !=
ExtensionToolbarModel::ACTION_SHOW_POPUP) {

Powered by Google App Engine
This is Rietveld 408576698