Skip to content

Commit

Permalink
Remove CalculatePreferredSize from BraveVPNStatusLabel (uplift to…
Browse files Browse the repository at this point in the history
… 1.71.x) (#25598)

Uplift of #25595 (squashed) to beta
  • Loading branch information
brave-builds authored Sep 17, 2024
1 parent 99dd126 commit 4a70290
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
15 changes: 0 additions & 15 deletions browser/ui/views/toolbar/brave_vpn_status_label.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,6 @@ void BraveVPNStatusLabel::OnConnectionStateChanged(ConnectionState state) {
UpdateState();
}

gfx::Size BraveVPNStatusLabel::CalculatePreferredSize(
const views::SizeBounds& available_size) const {
auto size = views::Label::CalculatePreferredSize(available_size);
if (longest_state_string_id_ == -1)
return size;
auto text =
brave_l10n::GetLocalizedResourceUTF16String(longest_state_string_id_);
if (text == GetText())
return size;
size.set_width(font_list().GetExpectedTextWidth(text.length()) +
GetInsets().width());
size.set_height(GetHeightForWidth(size.width()));
return size;
}

void BraveVPNStatusLabel::UpdateState() {
const auto state = service_->GetConnectionState();

Expand Down
3 changes: 0 additions & 3 deletions browser/ui/views/toolbar/brave_vpn_status_label.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class BraveVPNStatusLabel : public views::Label,
BraveVPNStatusLabel(const BraveVPNStatusLabel&) = delete;
BraveVPNStatusLabel& operator=(const BraveVPNStatusLabel&) = delete;

gfx::Size CalculatePreferredSize(
const views::SizeBounds& available_size) const override;

private:
// brave_vpn::BraveVPNServiceObserver overrides:
void OnConnectionStateChanged(
Expand Down

0 comments on commit 4a70290

Please sign in to comment.