From e3f4cc62db9c967b911b00399674e392c71d0a7d Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Thu, 1 Apr 2010 23:19:52 +0000 Subject: GTK: inspect page action popups. Forgot page actions when I wrote r42389 BUG=24477 TEST=manual Review URL: http://codereview.chromium.org/1558019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43406 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/location_bar_view_gtk.cc | 23 ++++++++++++++--------- chrome/browser/gtk/location_bar_view_gtk.h | 4 ++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/chrome/browser/gtk/location_bar_view_gtk.cc b/chrome/browser/gtk/location_bar_view_gtk.cc index b4febca..57e150c 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.cc +++ b/chrome/browser/gtk/location_bar_view_gtk.cc @@ -1261,21 +1261,26 @@ void LocationBarViewGtk::PageActionViewGtk::TestActivatePageAction() { void LocationBarViewGtk::PageActionViewGtk::InspectPopup( ExtensionAction* action) { - // TODO(estade): http://crbug.com/24477 - NOTIMPLEMENTED(); + ShowPopup(true); +} + +bool LocationBarViewGtk::PageActionViewGtk::ShowPopup(bool devtools) { + if (!page_action_->HasPopup(current_tab_id_)) + return false; + + ExtensionPopupGtk::Show( + page_action_->GetPopupUrl(current_tab_id_), + owner_->browser_, + gtk_util::GetWidgetRectRelativeToToplevel(event_box_.get()), + devtools); + return true; } gboolean LocationBarViewGtk::PageActionViewGtk::OnButtonPressed( GtkWidget* sender, GdkEvent* event) { if (event->button.button != 3) { - if (page_action_->HasPopup(current_tab_id_)) { - ExtensionPopupGtk::Show( - page_action_->GetPopupUrl(current_tab_id_), - owner_->browser_, - gtk_util::GetWidgetRectRelativeToToplevel(event_box_.get()), - false); - } else { + if (!ShowPopup(false)) { ExtensionBrowserEventRouter::GetInstance()->PageActionExecuted( profile_, page_action_->extension_id(), diff --git a/chrome/browser/gtk/location_bar_view_gtk.h b/chrome/browser/gtk/location_bar_view_gtk.h index 9ea3594..16373ad 100644 --- a/chrome/browser/gtk/location_bar_view_gtk.h +++ b/chrome/browser/gtk/location_bar_view_gtk.h @@ -205,6 +205,10 @@ class LocationBarViewGtk : public AutocompleteEditController, virtual void InspectPopup(ExtensionAction* action); private: + // Show the popup for this page action. If |devtools| is true, show it + // with a debugger window attached. Returns true if a popup was shown. + bool ShowPopup(bool devtools); + CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnButtonPressed, GdkEvent*); CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnExposeEvent, -- cgit v1.1