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