refactor: migrate to View::AddChildView(std::unique_ptr<ui::View*>)
(#46474)
* refactor: use AddChildView(std::unique_ptr<View>) in OpaqueFrameView::CreateButton() Xref: https://issues.chromium.org/issues/40485510 * refactor: use AddChildView(std::unique_ptr<View>) in MenuBar::RebuildChildren() * refactor: use AddChildView(std::unique_ptr<View>) for ClientFrameViewLinux labels * refactor: use AddChildView(std::unique_ptr<View>) for ClientFrameViewLinux buttons * refactor: use AddChildView(std::unique_ptr<View>) in AutofillPopupView * refactor: use AddChildViewRaw() to flag the edge cases that we still need to fix * chore: use west coast const for consistency
This commit is contained in:
parent
a6875c732c
commit
85dce12be3
10 changed files with 30 additions and 32 deletions
|
@ -229,11 +229,11 @@ void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
|
|||
void MenuBar::RebuildChildren() {
|
||||
RemoveAllChildViews();
|
||||
for (size_t i = 0, n = GetItemCount(); i < n; ++i) {
|
||||
auto* button = new SubmenuButton(
|
||||
auto button = std::make_unique<SubmenuButton>(
|
||||
base::BindRepeating(&MenuBar::ButtonPressed, base::Unretained(this), i),
|
||||
menu_model_->GetLabelAt(i), background_color_);
|
||||
button->SetID(i);
|
||||
AddChildView(button);
|
||||
AddChildView(std::move(button));
|
||||
}
|
||||
UpdateViewColors();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue