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

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

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address most TODOs and sync. Created 9 years, 9 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
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 376eddd358b2afadef864fc74af46577ce1eb282..d714aa265d57d9fa645b3754bfb225102f124dd6 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
@@ -102,10 +102,6 @@ void PageActionImageView::ExecuteAction(int button,
}
}
-void PageActionImageView::GetAccessibleState(ui::AccessibleViewState* state) {
- state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
-}
-
bool PageActionImageView::OnMousePressed(const views::MouseEvent& event) {
// We want to show the bubble on mouse release; that is the standard behavior
// for buttons. (Also, triggering on mouse press causes bugs like
@@ -113,9 +109,8 @@ bool PageActionImageView::OnMousePressed(const views::MouseEvent& event) {
return true;
}
-void PageActionImageView::OnMouseReleased(const views::MouseEvent& event,
- bool canceled) {
- if (canceled || !HitTest(event.location()))
+void PageActionImageView::OnMouseReleased(const views::MouseEvent& event) {
+ if (!HitTest(event.location()))
return;
int button = -1;
@@ -136,8 +131,9 @@ void PageActionImageView::OnMouseReleased(const views::MouseEvent& event,
ExecuteAction(button, false); // inspect_with_devtools
}
-bool PageActionImageView::OnKeyPressed(const views::KeyEvent& e) {
- if (e.key_code() == ui::VKEY_SPACE || e.key_code() == ui::VKEY_RETURN) {
+bool PageActionImageView::OnKeyPressed(const views::KeyEvent& event) {
+ if (event.key_code() == ui::VKEY_SPACE ||
+ event.key_code() == ui::VKEY_RETURN) {
ExecuteAction(1, false);
return true;
}
@@ -159,6 +155,10 @@ void PageActionImageView::ShowContextMenu(const gfx::Point& p,
context_menu_menu_->RunContextMenuAt(p);
}
+void PageActionImageView::GetAccessibleState(ui::AccessibleViewState* state) {
+ state->role = ui::AccessibilityTypes::ROLE_PUSHBUTTON;
+}
+
void PageActionImageView::OnImageLoaded(
SkBitmap* image, const ExtensionResource& resource, int index) {
// We loaded icons()->size() icons, plus one extra if the page action had

Powered by Google App Engine
This is Rietveld 408576698