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

Unified Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 430093003: Page action extension icons should handle tap events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: kViewClassName no longer public Created 6 years, 4 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
« no previous file with comments | « chrome/browser/ui/views/location_bar/page_action_image_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/page_action_image_view.cc
diff --git a/chrome/browser/ui/views/location_bar/page_action_image_view.cc b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
index 3ab5e7f317e767c730c505bc33557678661e0114..a47b7310fe6a991acdb31d59827b96eb53135119 100644
--- a/chrome/browser/ui/views/location_bar/page_action_image_view.cc
+++ b/chrome/browser/ui/views/location_bar/page_action_image_view.cc
@@ -33,6 +33,9 @@ using content::WebContents;
using extensions::LocationBarController;
using extensions::Extension;
+// static
+const char PageActionImageView::kViewClassName[] = "PageActionImageView";
+
PageActionImageView::PageActionImageView(LocationBarView* owner,
ExtensionAction* page_action,
Browser* browser)
@@ -113,6 +116,10 @@ void PageActionImageView::ExecuteAction(
}
}
+const char* PageActionImageView::GetClassName() const {
+ return kViewClassName;
+}
+
void PageActionImageView::GetAccessibleState(ui::AXViewState* state) {
state->role = ui::AX_ROLE_BUTTON;
state->name = base::UTF8ToUTF16(tooltip_);
@@ -147,6 +154,13 @@ bool PageActionImageView::OnKeyPressed(const ui::KeyEvent& event) {
return false;
}
+void PageActionImageView::OnGestureEvent(ui::GestureEvent* event) {
+ if (event->type() == ui::ET_GESTURE_TAP) {
+ ExecuteAction(ExtensionPopup::SHOW);
+ event->SetHandled();
+ }
+}
+
void PageActionImageView::ShowContextMenuForView(
View* source,
const gfx::Point& point,
« no previous file with comments | « chrome/browser/ui/views/location_bar/page_action_image_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698