| OLD | NEW |
| 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 "ui/views/controls/button/custom_button.h" | 5 #include "ui/views/controls/button/custom_button.h" |
| 6 | 6 |
| 7 #include "ui/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_view_state.h" |
| 8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
| 9 #include "ui/events/event_utils.h" | 9 #include "ui/events/event_utils.h" |
| 10 #include "ui/events/keycodes/keyboard_codes.h" | 10 #include "ui/events/keycodes/keyboard_codes.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 } | 179 } |
| 180 } | 180 } |
| 181 if (notify_action_ == NOTIFY_ON_RELEASE) | 181 if (notify_action_ == NOTIFY_ON_RELEASE) |
| 182 OnClickCanceled(event); | 182 OnClickCanceled(event); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void CustomButton::OnMouseCaptureLost() { | 185 void CustomButton::OnMouseCaptureLost() { |
| 186 // Starting a drag results in a MouseCaptureLost, we need to ignore it. | 186 // Starting a drag results in a MouseCaptureLost, we need to ignore it. |
| 187 if (state_ != STATE_DISABLED && !InDrag()) | 187 if (state_ != STATE_DISABLED && !InDrag()) |
| 188 SetState(STATE_NORMAL); | 188 SetState(STATE_NORMAL); |
| 189 if (ink_drop_delegate_) |
| 190 ink_drop_delegate_->OnAction(views::InkDropState::HIDDEN); |
| 189 } | 191 } |
| 190 | 192 |
| 191 void CustomButton::OnMouseEntered(const ui::MouseEvent& event) { | 193 void CustomButton::OnMouseEntered(const ui::MouseEvent& event) { |
| 192 if (state_ != STATE_DISABLED) | 194 if (state_ != STATE_DISABLED) |
| 193 SetState(STATE_HOVERED); | 195 SetState(STATE_HOVERED); |
| 194 } | 196 } |
| 195 | 197 |
| 196 void CustomButton::OnMouseExited(const ui::MouseEvent& event) { | 198 void CustomButton::OnMouseExited(const ui::MouseEvent& event) { |
| 197 // Starting a drag results in a MouseExited, we need to ignore it. | 199 // Starting a drag results in a MouseExited, we need to ignore it. |
| 198 if (state_ != STATE_DISABLED && !InDrag()) | 200 if (state_ != STATE_DISABLED && !InDrag()) |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); | 424 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); |
| 423 } | 425 } |
| 424 | 426 |
| 425 bool CustomButton::FocusInChildWidget() const { | 427 bool CustomButton::FocusInChildWidget() const { |
| 426 return GetWidget() && | 428 return GetWidget() && |
| 427 GetWidget()->GetRootView()->Contains( | 429 GetWidget()->GetRootView()->Contains( |
| 428 GetFocusManager()->GetFocusedView()); | 430 GetFocusManager()->GetFocusedView()); |
| 429 } | 431 } |
| 430 | 432 |
| 431 } // namespace views | 433 } // namespace views |
| OLD | NEW |