OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ash/common/accelerators/ash_focus_manager_factory.h" | |
6 | |
7 #include "ash/common/accelerators/accelerator_controller.h" | |
8 #include "ash/common/wm_shell.h" | |
9 #include "base/memory/ptr_util.h" | |
10 #include "ui/views/focus/focus_manager.h" | |
11 | |
12 namespace ash { | |
13 | |
14 AshFocusManagerFactory::AshFocusManagerFactory() {} | |
15 AshFocusManagerFactory::~AshFocusManagerFactory() {} | |
16 | |
17 views::FocusManager* AshFocusManagerFactory::CreateFocusManager( | |
18 views::Widget* widget, | |
19 bool desktop_widget) { | |
20 return new views::FocusManager( | |
21 widget, | |
22 desktop_widget ? nullptr : base::WrapUnique<Delegate>(new Delegate)); | |
23 } | |
24 | |
25 bool AshFocusManagerFactory::Delegate::ProcessAccelerator( | |
26 const ui::Accelerator& accelerator) { | |
27 AcceleratorController* controller = WmShell::Get()->accelerator_controller(); | |
28 if (controller) | |
29 return controller->Process(accelerator); | |
30 return false; | |
31 } | |
32 | |
33 } // namespace ash | |
OLD | NEW |