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

Unified Diff: ui/views/controls/button/custom_button.cc

Issue 10827198: Change View::HitTest to View::HitTestRect (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixed errors reported by trybots Created 8 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 | « ui/views/controls/button/button_dropdown.cc ('k') | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 2ac899a5fb9cfe2164977a1d756bf43b6e53f246..fe929bf22799f855f19e8b109c50b17d3188c90e 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -73,7 +73,7 @@ bool CustomButton::IsMouseHovered() const {
gfx::Point cursor_pos(gfx::Screen::GetCursorScreenPoint());
ConvertPointToView(NULL, this, &cursor_pos);
- return HitTest(cursor_pos);
+ return HitTestPoint(cursor_pos);
}
void CustomButton::SetHotTracked(bool is_hot_tracked) {
@@ -109,7 +109,7 @@ std::string CustomButton::GetClassName() const {
bool CustomButton::OnMousePressed(const MouseEvent& event) {
if (state_ != BS_DISABLED) {
- if (ShouldEnterPushedState(event) && HitTest(event.location()))
+ if (ShouldEnterPushedState(event) && HitTestPoint(event.location()))
SetState(BS_PUSHED);
if (request_focus_on_press_)
RequestFocus();
@@ -119,7 +119,7 @@ bool CustomButton::OnMousePressed(const MouseEvent& event) {
bool CustomButton::OnMouseDragged(const MouseEvent& event) {
if (state_ != BS_DISABLED) {
- if (HitTest(event.location()))
+ if (HitTestPoint(event.location()))
SetState(ShouldEnterPushedState(event) ? BS_PUSHED : BS_HOT);
else
SetState(BS_NORMAL);
@@ -131,7 +131,7 @@ void CustomButton::OnMouseReleased(const MouseEvent& event) {
if (state_ == BS_DISABLED)
return;
- if (!HitTest(event.location())) {
+ if (!HitTestPoint(event.location())) {
SetState(BS_NORMAL);
return;
}
@@ -163,7 +163,7 @@ void CustomButton::OnMouseExited(const MouseEvent& event) {
void CustomButton::OnMouseMoved(const MouseEvent& event) {
if (state_ != BS_DISABLED)
- SetState(HitTest(event.location()) ? BS_HOT : BS_NORMAL);
+ SetState(HitTestPoint(event.location()) ? BS_HOT : BS_NORMAL);
}
bool CustomButton::OnKeyPressed(const KeyEvent& event) {
« no previous file with comments | « ui/views/controls/button/button_dropdown.cc ('k') | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698