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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
396 const ViewHierarchyChangedDetails& details) { | 396 const ViewHierarchyChangedDetails& details) { |
397 if (!details.is_add && state_ != STATE_DISABLED) | 397 if (!details.is_add && state_ != STATE_DISABLED) |
398 SetState(STATE_NORMAL); | 398 SetState(STATE_NORMAL); |
399 } | 399 } |
400 | 400 |
401 void CustomButton::OnBlur() { | 401 void CustomButton::OnBlur() { |
402 if (IsHotTracked()) | 402 if (IsHotTracked()) |
403 SetState(STATE_NORMAL); | 403 SetState(STATE_NORMAL); |
404 } | 404 } |
405 | 405 |
406 void CustomButton::NotifyClick(const ui::Event& event) { | |
407 Button::NotifyClick(event); | |
408 if (ink_drop_delegate()) | |
409 ink_drop_delegate()->OnAction(views::InkDropState::QUICK_ACTION); | |
varkha
2015/11/27 22:07:50
If we are doing this in CustomButton then we shoul
bruthig
2015/12/07 18:44:46
Done.
| |
410 } | |
411 | |
406 bool CustomButton::IsChildWidget() const { | 412 bool CustomButton::IsChildWidget() const { |
407 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); | 413 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); |
408 } | 414 } |
409 | 415 |
410 bool CustomButton::FocusInChildWidget() const { | 416 bool CustomButton::FocusInChildWidget() const { |
411 return GetWidget() && | 417 return GetWidget() && |
412 GetWidget()->GetRootView()->Contains( | 418 GetWidget()->GetRootView()->Contains( |
413 GetFocusManager()->GetFocusedView()); | 419 GetFocusManager()->GetFocusedView()); |
414 } | 420 } |
415 | 421 |
416 } // namespace views | 422 } // namespace views |
OLD | NEW |