Commit 958401ce authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Removed LabelButton::GetChildAreaBounds().

It was virtual at some point, but never overridden. The virtual was removed in a previous CL, which rendered its intent as moot.

Change-Id: Ia6c4ac1a5cd657e0ccc682508b35fc652e4b7e64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872754
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Auto-Submit: Allen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708274}
parent 228f321c
...@@ -245,21 +245,19 @@ int LabelButton::GetHeightForWidth(int width) const { ...@@ -245,21 +245,19 @@ int LabelButton::GetHeightForWidth(int width) const {
} }
void LabelButton::Layout() { void LabelButton::Layout() {
ink_drop_container_->SetBoundsRect(GetLocalBounds()); gfx::Rect child_area = GetLocalBounds();
// By default, GetChildAreaBounds() ignores the top and bottom border, but we ink_drop_container_->SetBoundsRect(child_area);
// want the image to respect it.
gfx::Rect child_area(GetChildAreaBounds());
// The space that the label can use. Its actual bounds may be smaller if the // The space that the label can use. Its actual bounds may be smaller if the
// label is short. // label is short.
gfx::Rect label_area(child_area); gfx::Rect label_area = child_area;
gfx::Insets insets = GetInsets(); gfx::Insets insets = GetInsets();
child_area.Inset(insets); child_area.Inset(insets);
// Labels can paint over the vertical component of the border insets. // Labels can paint over the vertical component of the border insets.
label_area.Inset(insets.left(), 0, insets.right(), 0); label_area.Inset(insets.left(), 0, insets.right(), 0);
gfx::Size image_size(image_->GetPreferredSize()); gfx::Size image_size = image_->GetPreferredSize();
image_size.SetToMin(child_area.size()); image_size.SetToMin(child_area.size());
const auto horizontal_alignment = GetHorizontalAlignment(); const auto horizontal_alignment = GetHorizontalAlignment();
...@@ -275,7 +273,7 @@ void LabelButton::Layout() { ...@@ -275,7 +273,7 @@ void LabelButton::Layout() {
std::min(label_area.width(), label_->GetPreferredSize().width()), std::min(label_area.width(), label_->GetPreferredSize().width()),
label_area.height()); label_area.height());
gfx::Point image_origin(child_area.origin()); gfx::Point image_origin = child_area.origin();
if (label_->GetMultiLine()) { if (label_->GetMultiLine()) {
// Right now this code currently only works for CheckBox and RadioButton // Right now this code currently only works for CheckBox and RadioButton
// descendants that have multi-line enabled for their label. // descendants that have multi-line enabled for their label.
...@@ -391,10 +389,6 @@ void LabelButton::RemoveLayerBeneathView(ui::Layer* old_layer) { ...@@ -391,10 +389,6 @@ void LabelButton::RemoveLayerBeneathView(ui::Layer* old_layer) {
image()->DestroyLayer(); image()->DestroyLayer();
} }
gfx::Rect LabelButton::GetChildAreaBounds() {
return GetLocalBounds();
}
void LabelButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const { void LabelButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
params->button.checked = false; params->button.checked = false;
params->button.indeterminate = false; params->button.indeterminate = false;
......
...@@ -142,10 +142,6 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { ...@@ -142,10 +142,6 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate {
// set with SetBorder. // set with SetBorder.
void UpdateThemedBorder(); void UpdateThemedBorder();
// Returns the available area for the label and image. Subclasses can change
// these bounds if they need room to do manual painting.
gfx::Rect GetChildAreaBounds();
// Fills |params| with information about the button. // Fills |params| with information about the button.
virtual void GetExtraParams(ui::NativeTheme::ExtraParams* params) const; virtual void GetExtraParams(ui::NativeTheme::ExtraParams* params) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment