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/label_button.h" | 5 #include "ui/views/controls/button/label_button.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 case STATE_NORMAL: return ui::NativeTheme::kNormal; | 494 case STATE_NORMAL: return ui::NativeTheme::kNormal; |
495 case STATE_HOVERED: return ui::NativeTheme::kHovered; | 495 case STATE_HOVERED: return ui::NativeTheme::kHovered; |
496 case STATE_PRESSED: return ui::NativeTheme::kPressed; | 496 case STATE_PRESSED: return ui::NativeTheme::kPressed; |
497 case STATE_DISABLED: return ui::NativeTheme::kDisabled; | 497 case STATE_DISABLED: return ui::NativeTheme::kDisabled; |
498 case STATE_COUNT: NOTREACHED() << "Unknown state: " << state(); | 498 case STATE_COUNT: NOTREACHED() << "Unknown state: " << state(); |
499 } | 499 } |
500 return ui::NativeTheme::kNormal; | 500 return ui::NativeTheme::kNormal; |
501 } | 501 } |
502 | 502 |
503 const gfx::Animation* LabelButton::GetThemeAnimation() const { | 503 const gfx::Animation* LabelButton::GetThemeAnimation() const { |
504 return hover_animation_.get(); | 504 return &hover_animation(); |
505 } | 505 } |
506 | 506 |
507 ui::NativeTheme::State LabelButton::GetBackgroundThemeState( | 507 ui::NativeTheme::State LabelButton::GetBackgroundThemeState( |
508 ui::NativeTheme::ExtraParams* params) const { | 508 ui::NativeTheme::ExtraParams* params) const { |
509 GetExtraParams(params); | 509 GetExtraParams(params); |
510 return ui::NativeTheme::kNormal; | 510 return ui::NativeTheme::kNormal; |
511 } | 511 } |
512 | 512 |
513 ui::NativeTheme::State LabelButton::GetForegroundThemeState( | 513 ui::NativeTheme::State LabelButton::GetForegroundThemeState( |
514 ui::NativeTheme::ExtraParams* params) const { | 514 ui::NativeTheme::ExtraParams* params) const { |
515 GetExtraParams(params); | 515 GetExtraParams(params); |
516 return ui::NativeTheme::kHovered; | 516 return ui::NativeTheme::kHovered; |
517 } | 517 } |
518 | 518 |
519 void LabelButton::ResetCachedPreferredSize() { | 519 void LabelButton::ResetCachedPreferredSize() { |
520 cached_preferred_size_valid_ = false; | 520 cached_preferred_size_valid_ = false; |
521 cached_preferred_size_ = gfx::Size(); | 521 cached_preferred_size_ = gfx::Size(); |
522 } | 522 } |
523 | 523 |
524 } // namespace views | 524 } // namespace views |
OLD | NEW |