Commit 18399cb6 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Replace inlined instances of GetContentsBounds()

Bug: None
Change-Id: Ic53917460d7cc0e68868e5c37a94df42ee930a65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1725007Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#682135}
parent 376c4c79
...@@ -327,8 +327,7 @@ HintBox::HintBox(const gfx::Rect& bounds, int border_radius) ...@@ -327,8 +327,7 @@ HintBox::HintBox(const gfx::Rect& bounds, int border_radius)
bounds.width() + 2 * base_border_ + arrow_width_, bounds.width() + 2 * base_border_ + arrow_width_,
bounds.height() + 2 * base_border_); bounds.height() + 2 * base_border_);
rounded_rect_bounds_ = GetLocalBounds(); rounded_rect_bounds_ = GetContentsBounds();
rounded_rect_bounds_.Inset(GetInsets());
flags_.setColor(SK_ColorWHITE); flags_.setColor(SK_ColorWHITE);
flags_.setStyle(cc::PaintFlags::kFill_Style); flags_.setStyle(cc::PaintFlags::kFill_Style);
...@@ -352,8 +351,7 @@ HintBox::~HintBox() = default; ...@@ -352,8 +351,7 @@ HintBox::~HintBox() = default;
void HintBox::UpdateWidth(int updated_width) { void HintBox::UpdateWidth(int updated_width) {
SetSize(gfx::Size(updated_width + 2 * base_border_ + arrow_width_, height())); SetSize(gfx::Size(updated_width + 2 * base_border_ + arrow_width_, height()));
rounded_rect_bounds_ = GetLocalBounds(); rounded_rect_bounds_ = GetContentsBounds();
rounded_rect_bounds_.Inset(GetInsets());
} }
void HintBox::SetLabel(const base::string16& text, const SkColor& color) { void HintBox::SetLabel(const base::string16& text, const SkColor& color) {
......
...@@ -77,8 +77,7 @@ void MediaGalleryCheckboxView::Layout() { ...@@ -77,8 +77,7 @@ void MediaGalleryCheckboxView::Layout() {
if (!secondary_text_->GetVisible()) if (!secondary_text_->GetVisible())
secondary_text_width = 0; secondary_text_width = 0;
gfx::Rect area(GetLocalBounds()); gfx::Rect area = GetContentsBounds();
area.Inset(GetInsets());
if (secondary_text_width > area.width() / 2) { if (secondary_text_width > area.width() / 2) {
secondary_text_width = secondary_text_width =
......
...@@ -158,8 +158,7 @@ int CredentialsItemView::GetHeightForWidth(int w) const { ...@@ -158,8 +158,7 @@ int CredentialsItemView::GetHeightForWidth(int w) const {
} }
void CredentialsItemView::Layout() { void CredentialsItemView::Layout() {
gfx::Rect child_area(GetLocalBounds()); gfx::Rect child_area = GetContentsBounds();
child_area.Inset(GetInsets());
gfx::Size image_size(image_view_->GetPreferredSize()); gfx::Size image_size(image_view_->GetPreferredSize());
image_size.SetToMin(child_area.size()); image_size.SetToMin(child_area.size());
......
...@@ -111,9 +111,7 @@ class MultilineExample::RenderTextView : public View { ...@@ -111,9 +111,7 @@ class MultilineExample::RenderTextView : public View {
private: private:
void OnBoundsChanged(const gfx::Rect& previous_bounds) override { void OnBoundsChanged(const gfx::Rect& previous_bounds) override {
gfx::Rect bounds = GetLocalBounds(); render_text_->SetDisplayRect(GetContentsBounds());
bounds.Inset(GetInsets());
render_text_->SetDisplayRect(bounds);
} }
std::unique_ptr<gfx::RenderText> render_text_; std::unique_ptr<gfx::RenderText> render_text_;
......
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