Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2467)

Unified Diff: ash/accelerators/ash_focus_manager_factory.cc

Issue 2953243002: FocusManagerFactory::Create() should return a unique_ptr. (Closed)
Patch Set: build Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/accelerators/ash_focus_manager_factory.h ('k') | ui/views/focus/focus_manager_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/ash_focus_manager_factory.cc
diff --git a/ash/accelerators/ash_focus_manager_factory.cc b/ash/accelerators/ash_focus_manager_factory.cc
index d9091cdb029661f332032e0eac00e384bf85d75e..b22c9a9f0fee6ec9464f92325b93eab03b224d4d 100644
--- a/ash/accelerators/ash_focus_manager_factory.cc
+++ b/ash/accelerators/ash_focus_manager_factory.cc
@@ -14,20 +14,20 @@ namespace ash {
AshFocusManagerFactory::AshFocusManagerFactory() {}
AshFocusManagerFactory::~AshFocusManagerFactory() {}
-views::FocusManager* AshFocusManagerFactory::CreateFocusManager(
+std::unique_ptr<views::FocusManager> AshFocusManagerFactory::CreateFocusManager(
views::Widget* widget,
bool desktop_widget) {
- return new views::FocusManager(
- widget,
- desktop_widget ? nullptr : base::WrapUnique<Delegate>(new Delegate));
+ return base::MakeUnique<views::FocusManager>(
+ widget, desktop_widget ? nullptr : base::MakeUnique<Delegate>());
}
+AshFocusManagerFactory::Delegate::Delegate() {}
+AshFocusManagerFactory::Delegate::~Delegate() {}
+
bool AshFocusManagerFactory::Delegate::ProcessAccelerator(
const ui::Accelerator& accelerator) {
AcceleratorController* controller = Shell::Get()->accelerator_controller();
- if (controller)
- return controller->Process(accelerator);
- return false;
+ return controller && controller->Process(accelerator);
}
} // namespace ash
« no previous file with comments | « ash/accelerators/ash_focus_manager_factory.h ('k') | ui/views/focus/focus_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698