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/accelerators/focus_manager_factory.h" | 5 #include "ash/accelerators/focus_manager_factory.h" |
6 | 6 |
7 #include "ash/common/accelerators/accelerator_controller.h" | 7 #include "ash/common/accelerators/accelerator_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/common/wm_shell.h" |
9 #include "ui/views/focus/focus_manager.h" | 9 #include "ui/views/focus/focus_manager.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 | 12 |
13 AshFocusManagerFactory::AshFocusManagerFactory() {} | 13 AshFocusManagerFactory::AshFocusManagerFactory() {} |
14 AshFocusManagerFactory::~AshFocusManagerFactory() {} | 14 AshFocusManagerFactory::~AshFocusManagerFactory() {} |
15 | 15 |
16 views::FocusManager* AshFocusManagerFactory::CreateFocusManager( | 16 views::FocusManager* AshFocusManagerFactory::CreateFocusManager( |
17 views::Widget* widget, | 17 views::Widget* widget, |
18 bool desktop_widget) { | 18 bool desktop_widget) { |
19 return new views::FocusManager(widget, desktop_widget ? NULL : new Delegate); | 19 return new views::FocusManager(widget, desktop_widget ? NULL : new Delegate); |
20 } | 20 } |
21 | 21 |
22 bool AshFocusManagerFactory::Delegate::ProcessAccelerator( | 22 bool AshFocusManagerFactory::Delegate::ProcessAccelerator( |
23 const ui::Accelerator& accelerator) { | 23 const ui::Accelerator& accelerator) { |
24 AcceleratorController* controller = | 24 AcceleratorController* controller = WmShell::Get()->accelerator_controller(); |
25 Shell::GetInstance()->accelerator_controller(); | |
26 if (controller) | 25 if (controller) |
27 return controller->Process(accelerator); | 26 return controller->Process(accelerator); |
28 return false; | 27 return false; |
29 } | 28 } |
30 | 29 |
31 } // namespace ash | 30 } // namespace ash |
OLD | NEW |