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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 324 } |
325 | 325 |
326 //////////////////////////////////////////////////////////////////////////////// | 326 //////////////////////////////////////////////////////////////////////////////// |
327 // CustomButton, gfx::AnimationDelegate implementation: | 327 // CustomButton, gfx::AnimationDelegate implementation: |
328 | 328 |
329 void CustomButton::AnimationProgressed(const gfx::Animation* animation) { | 329 void CustomButton::AnimationProgressed(const gfx::Animation* animation) { |
330 SchedulePaint(); | 330 SchedulePaint(); |
331 } | 331 } |
332 | 332 |
333 //////////////////////////////////////////////////////////////////////////////// | 333 //////////////////////////////////////////////////////////////////////////////// |
| 334 // CustomButton, views::InkDropHost implementation: |
| 335 |
| 336 gfx::Point CustomButton::CalculateInkDropCenter() const { |
| 337 return GetLocalBounds().CenterPoint(); |
| 338 } |
| 339 |
| 340 //////////////////////////////////////////////////////////////////////////////// |
334 // CustomButton, protected: | 341 // CustomButton, protected: |
335 | 342 |
336 CustomButton::CustomButton(ButtonListener* listener) | 343 CustomButton::CustomButton(ButtonListener* listener) |
337 : Button(listener), | 344 : Button(listener), |
338 state_(STATE_NORMAL), | 345 state_(STATE_NORMAL), |
339 animate_on_state_change_(true), | 346 animate_on_state_change_(true), |
340 is_throbbing_(false), | 347 is_throbbing_(false), |
341 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), | 348 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), |
342 request_focus_on_press_(true), | 349 request_focus_on_press_(true), |
343 ink_drop_delegate_(nullptr), | 350 ink_drop_delegate_(nullptr), |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); | 429 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); |
423 } | 430 } |
424 | 431 |
425 bool CustomButton::FocusInChildWidget() const { | 432 bool CustomButton::FocusInChildWidget() const { |
426 return GetWidget() && | 433 return GetWidget() && |
427 GetWidget()->GetRootView()->Contains( | 434 GetWidget()->GetRootView()->Contains( |
428 GetFocusManager()->GetFocusedView()); | 435 GetFocusManager()->GetFocusedView()); |
429 } | 436 } |
430 | 437 |
431 } // namespace views | 438 } // namespace views |
OLD | NEW |