| 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/keycodes/keyboard_codes.h" | 9 #include "ui/events/keycodes/keyboard_codes.h" |
| 10 #include "ui/gfx/animation/throb_animation.h" | 10 #include "ui/gfx/animation/throb_animation.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 } | 281 } |
| 282 | 282 |
| 283 void CustomButton::OnDragDone() { | 283 void CustomButton::OnDragDone() { |
| 284 SetState(STATE_NORMAL); | 284 SetState(STATE_NORMAL); |
| 285 } | 285 } |
| 286 | 286 |
| 287 void CustomButton::GetAccessibleState(ui::AXViewState* state) { | 287 void CustomButton::GetAccessibleState(ui::AXViewState* state) { |
| 288 Button::GetAccessibleState(state); | 288 Button::GetAccessibleState(state); |
| 289 switch (state_) { | 289 switch (state_) { |
| 290 case STATE_HOVERED: | 290 case STATE_HOVERED: |
| 291 state->state = ui::AX_STATE_HOVERED; | 291 state->AddStateFlag(ui::AX_STATE_HOVERED); |
| 292 break; | 292 break; |
| 293 case STATE_PRESSED: | 293 case STATE_PRESSED: |
| 294 state->state = ui::AX_STATE_PRESSED; | 294 state->AddStateFlag(ui::AX_STATE_PRESSED); |
| 295 break; | 295 break; |
| 296 case STATE_DISABLED: | 296 case STATE_DISABLED: |
| 297 state->state = ui::AX_STATE_DISABLED; | 297 state->AddStateFlag(ui::AX_STATE_DISABLED); |
| 298 break; | 298 break; |
| 299 case STATE_NORMAL: | 299 case STATE_NORMAL: |
| 300 case STATE_COUNT: | 300 case STATE_COUNT: |
| 301 // No additional accessibility state set for this button state. | 301 // No additional accessibility state set for this button state. |
| 302 break; | 302 break; |
| 303 } | 303 } |
| 304 } | 304 } |
| 305 | 305 |
| 306 void CustomButton::VisibilityChanged(View* starting_from, bool visible) { | 306 void CustomButton::VisibilityChanged(View* starting_from, bool visible) { |
| 307 if (state_ == STATE_DISABLED) | 307 if (state_ == STATE_DISABLED) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 if (!details.is_add && state_ != STATE_DISABLED) | 352 if (!details.is_add && state_ != STATE_DISABLED) |
| 353 SetState(STATE_NORMAL); | 353 SetState(STATE_NORMAL); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void CustomButton::OnBlur() { | 356 void CustomButton::OnBlur() { |
| 357 if (IsHotTracked()) | 357 if (IsHotTracked()) |
| 358 SetState(STATE_NORMAL); | 358 SetState(STATE_NORMAL); |
| 359 } | 359 } |
| 360 | 360 |
| 361 } // namespace views | 361 } // namespace views |
| OLD | NEW |