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