| 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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 gfx::Rect LabelButton::GetChildAreaBounds() { | 375 gfx::Rect LabelButton::GetChildAreaBounds() { |
| 376 return GetLocalBounds(); | 376 return GetLocalBounds(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 void LabelButton::OnPaint(gfx::Canvas* canvas) { | 379 void LabelButton::OnPaint(gfx::Canvas* canvas) { |
| 380 View::OnPaint(canvas); | 380 View::OnPaint(canvas); |
| 381 Painter::PaintFocusPainter(this, canvas, focus_painter_.get()); | 381 Painter::PaintFocusPainter(this, canvas, focus_painter_.get()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 void LabelButton::OnFocus() { | 384 void LabelButton::OnFocus() { |
| 385 View::OnFocus(); | 385 CustomButton::OnFocus(); |
| 386 // Typically the border renders differently when focused. | 386 // Typically the border renders differently when focused. |
| 387 SchedulePaint(); | 387 SchedulePaint(); |
| 388 } | 388 } |
| 389 | 389 |
| 390 void LabelButton::OnBlur() { | 390 void LabelButton::OnBlur() { |
| 391 View::OnBlur(); | 391 CustomButton::OnBlur(); |
| 392 // Typically the border renders differently when focused. | 392 // Typically the border renders differently when focused. |
| 393 SchedulePaint(); | 393 SchedulePaint(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void LabelButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 396 void LabelButton::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
| 397 ResetColorsFromNativeTheme(); | 397 ResetColorsFromNativeTheme(); |
| 398 UpdateThemedBorder(); | 398 UpdateThemedBorder(); |
| 399 // Invalidate the layout to pickup the new insets from the border. | 399 // Invalidate the layout to pickup the new insets from the border. |
| 400 InvalidateLayout(); | 400 InvalidateLayout(); |
| 401 } | 401 } |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 GetExtraParams(params); | 567 GetExtraParams(params); |
| 568 return ui::NativeTheme::kHovered; | 568 return ui::NativeTheme::kHovered; |
| 569 } | 569 } |
| 570 | 570 |
| 571 void LabelButton::ResetCachedPreferredSize() { | 571 void LabelButton::ResetCachedPreferredSize() { |
| 572 cached_preferred_size_valid_ = false; | 572 cached_preferred_size_valid_ = false; |
| 573 cached_preferred_size_ = gfx::Size(); | 573 cached_preferred_size_ = gfx::Size(); |
| 574 } | 574 } |
| 575 | 575 |
| 576 } // namespace views | 576 } // namespace views |
| OLD | NEW |