chore: use std::make_unique/base::MakeRefCounted when possible (#29510)

This commit is contained in:
David Sanders 2021-06-07 19:00:05 -07:00 committed by GitHub
parent a4decffe9a
commit 79cb5144ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 106 additions and 101 deletions

View file

@ -210,9 +210,9 @@ void NotifyIcon::PopUpContextMenu(const gfx::Point& pos,
if (pos.IsOrigin())
rect.set_origin(display::Screen::GetScreen()->GetCursorScreenPoint());
menu_runner_.reset(
new views::MenuRunner(menu_model != nullptr ? menu_model : menu_model_,
views::MenuRunner::HAS_MNEMONICS));
menu_runner_ = std::make_unique<views::MenuRunner>(
menu_model != nullptr ? menu_model : menu_model_,
views::MenuRunner::HAS_MNEMONICS);
menu_runner_->RunMenuAt(nullptr, nullptr, rect,
views::MenuAnchorPosition::kTopLeft,
ui::MENU_SOURCE_MOUSE);