summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.cc23
-rw-r--r--chrome/browser/gtk/location_bar_view_gtk.h4
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,