summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-01 23:19:52 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-01 23:19:52 +0000
commite3f4cc62db9c967b911b00399674e392c71d0a7d (patch)
tree9048cd15263ba4a1f62ef26ff97bbc183ded6254
parentb0bc449d01c0b6a06f47fd38388347e7acf95d71 (diff)
downloadchromium_src-e3f4cc62db9c967b911b00399674e392c71d0a7d.zip
chromium_src-e3f4cc62db9c967b911b00399674e392c71d0a7d.tar.gz
chromium_src-e3f4cc62db9c967b911b00399674e392c71d0a7d.tar.bz2
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
-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,