Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 1534303002: CustomButton cleanup: make protected members private, create accessors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert a change Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/gfx/animation/throb_animation.h" 9 #include "ui/gfx/animation/throb_animation.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 case STATE_NORMAL: return ui::NativeTheme::kNormal; 489 case STATE_NORMAL: return ui::NativeTheme::kNormal;
490 case STATE_HOVERED: return ui::NativeTheme::kHovered; 490 case STATE_HOVERED: return ui::NativeTheme::kHovered;
491 case STATE_PRESSED: return ui::NativeTheme::kPressed; 491 case STATE_PRESSED: return ui::NativeTheme::kPressed;
492 case STATE_DISABLED: return ui::NativeTheme::kDisabled; 492 case STATE_DISABLED: return ui::NativeTheme::kDisabled;
493 case STATE_COUNT: NOTREACHED() << "Unknown state: " << state(); 493 case STATE_COUNT: NOTREACHED() << "Unknown state: " << state();
494 } 494 }
495 return ui::NativeTheme::kNormal; 495 return ui::NativeTheme::kNormal;
496 } 496 }
497 497
498 const gfx::Animation* LabelButton::GetThemeAnimation() const { 498 const gfx::Animation* LabelButton::GetThemeAnimation() const {
499 return hover_animation_.get(); 499 return &hover_animation();
500 } 500 }
501 501
502 ui::NativeTheme::State LabelButton::GetBackgroundThemeState( 502 ui::NativeTheme::State LabelButton::GetBackgroundThemeState(
503 ui::NativeTheme::ExtraParams* params) const { 503 ui::NativeTheme::ExtraParams* params) const {
504 GetExtraParams(params); 504 GetExtraParams(params);
505 return ui::NativeTheme::kNormal; 505 return ui::NativeTheme::kNormal;
506 } 506 }
507 507
508 ui::NativeTheme::State LabelButton::GetForegroundThemeState( 508 ui::NativeTheme::State LabelButton::GetForegroundThemeState(
509 ui::NativeTheme::ExtraParams* params) const { 509 ui::NativeTheme::ExtraParams* params) const {
510 GetExtraParams(params); 510 GetExtraParams(params);
511 return ui::NativeTheme::kHovered; 511 return ui::NativeTheme::kHovered;
512 } 512 }
513 513
514 void LabelButton::ResetCachedPreferredSize() { 514 void LabelButton::ResetCachedPreferredSize() {
515 cached_preferred_size_valid_ = false; 515 cached_preferred_size_valid_ = false;
516 cached_preferred_size_ = gfx::Size(); 516 cached_preferred_size_ = gfx::Size();
517 } 517 }
518 518
519 } // namespace views 519 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698