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

Unified Diff: chrome/browser/ui/gtk/browser_actions_toolbar_gtk.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/gtk/browser_actions_toolbar_gtk.cc
diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
index 34f300ac07e04720260efa3d538186ec84698fb7..1c6575f266afebec54c2ce3d7e4714cd9f3ae6a0 100644
--- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
+++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc
@@ -24,6 +24,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/gtk/browser_window_gtk.h"
#include "chrome/browser/ui/gtk/custom_button.h"
#include "chrome/browser/ui/gtk/extensions/extension_popup_gtk.h"
@@ -768,6 +769,22 @@ void BrowserActionsToolbarGtk::BrowserActionMoved(const Extension* extension,
gtk_box_reorder_child(GTK_BOX(button_hbox_.get()), button_widget, index);
}
+void BrowserActionsToolbarGtk::BrowserActionShowPopup(
+ const Extension* extension) {
+ // Do not override other popups and only show in active window.
+ if (ExtensionPopupGtk::get_current_extension_popup() != NULL ||
mark a. foltz 2013/10/11 20:25:30 Does the toolbar model know if there is an active
justinlin 2013/10/16 07:06:48 No, the model doesn't know anything about whether
+ BrowserList::GetInstance(chrome::GetActiveDesktop())->GetLastActive() !=
+ browser()) {
+ return;
+ }
+
+ GURL popupUrl = model_->GetPopupUrl(extension, browser());
+ if (!popupUrl.is_empty()) {
+ ExtensionPopupGtk::Show(popup_url, browser(), button->widget(),
+ ExtensionPopupGtk::SHOW);
+ }
+}
+
void BrowserActionsToolbarGtk::ModelLoaded() {
SetContainerWidth();
}

Powered by Google App Engine
This is Rietveld 408576698