chore: use std::make_unique/base::MakeRefCounted when possible (#29510)
This commit is contained in:
parent
a4decffe9a
commit
79cb5144ae
38 changed files with 106 additions and 101 deletions
|
@ -192,7 +192,8 @@ void SystemPreferences::InitializeWindow() {
|
|||
// Creating this listener before the app is ready causes global shortcuts
|
||||
// to not fire
|
||||
if (Browser::Get()->is_ready())
|
||||
color_change_listener_.reset(new gfx::ScopedSysColorChangeListener(this));
|
||||
color_change_listener_ =
|
||||
std::make_unique<gfx::ScopedSysColorChangeListener>(this);
|
||||
else
|
||||
Browser::Get()->AddObserver(this);
|
||||
|
||||
|
@ -259,7 +260,8 @@ void SystemPreferences::OnSysColorChange() {
|
|||
|
||||
void SystemPreferences::OnFinishLaunching(
|
||||
const base::DictionaryValue& launch_info) {
|
||||
color_change_listener_.reset(new gfx::ScopedSysColorChangeListener(this));
|
||||
color_change_listener_ =
|
||||
std::make_unique<gfx::ScopedSysColorChangeListener>(this);
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue