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

Side by Side Diff: chrome/browser/ui/views/location_bar/page_action_image_view.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" 5 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/commands/command_service.h" 8 #include "chrome/browser/extensions/api/commands/command_service.h"
9 #include "chrome/browser/extensions/extension_action.h" 9 #include "chrome/browser/extensions/extension_action.h"
10 #include "chrome/browser/extensions/extension_action_icon_factory.h" 10 #include "chrome/browser/extensions/extension_action_icon_factory.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 bool PageActionImageView::OnMousePressed(const ui::MouseEvent& event) { 119 bool PageActionImageView::OnMousePressed(const ui::MouseEvent& event) {
120 // We want to show the bubble on mouse release; that is the standard behavior 120 // We want to show the bubble on mouse release; that is the standard behavior
121 // for buttons. (Also, triggering on mouse press causes bugs like 121 // for buttons. (Also, triggering on mouse press causes bugs like
122 // http://crbug.com/33155.) 122 // http://crbug.com/33155.)
123 return true; 123 return true;
124 } 124 }
125 125
126 void PageActionImageView::OnMouseReleased(const ui::MouseEvent& event) { 126 void PageActionImageView::OnMouseReleased(const ui::MouseEvent& event) {
127 if (!HitTestPoint(event.location())) 127 if (!HitTestPoint(gfx::ToFlooredPoint(event.location())))
128 return; 128 return;
129 129
130 if (event.IsRightMouseButton()) { 130 if (event.IsRightMouseButton()) {
131 // Don't show a menu here, its handled in View::ProcessMouseReleased. We 131 // Don't show a menu here, its handled in View::ProcessMouseReleased. We
132 // show the context menu by way of being the ContextMenuController. 132 // show the context menu by way of being the ContextMenuController.
133 return; 133 return;
134 } 134 }
135 135
136 ExecuteAction(ExtensionPopup::SHOW); 136 ExecuteAction(ExtensionPopup::SHOW);
137 } 137 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 250
251 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, this, arrow, 251 popup_ = ExtensionPopup::ShowPopup(popup_url, browser_, this, arrow,
252 show_action); 252 show_action);
253 popup_->GetWidget()->AddObserver(this); 253 popup_->GetWidget()->AddObserver(this);
254 } 254 }
255 255
256 void PageActionImageView::HidePopup() { 256 void PageActionImageView::HidePopup() {
257 if (popup_) 257 if (popup_)
258 popup_->GetWidget()->Close(); 258 popup_->GetWidget()->Close();
259 } 259 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698