Skip to content

Commit

Permalink
GTK: inspect page action popups.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
estade@chromium.org committed Apr 1, 2010
1 parent b0bc449 commit e3f4cc6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
23 changes: 14 additions & 9 deletions chrome/browser/gtk/location_bar_view_gtk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/gtk/location_bar_view_gtk.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e3f4cc6

Please sign in to comment.