blob: 0695fd3e7a099318ae1e973ba03899ef78bd4ba2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/accelerators/focus_manager_factory.h"
#include "ash/accelerators/accelerator_controller.h"
#include "ash/shell.h"
#include "ui/views/focus/focus_manager.h"
namespace ash {
AshFocusManagerFactory::AshFocusManagerFactory() {}
AshFocusManagerFactory::~AshFocusManagerFactory() {}
views::FocusManager* AshFocusManagerFactory::CreateFocusManager(
views::Widget* widget,
bool desktop_widget) {
return new views::FocusManager(widget, desktop_widget ? NULL : new Delegate);
}
bool AshFocusManagerFactory::Delegate::ProcessAccelerator(
const ui::Accelerator& accelerator) {
AcceleratorController* controller =
Shell::GetInstance()->accelerator_controller();
if (controller)
return controller->Process(accelerator);
return false;
}
ui::AcceleratorTarget*
AshFocusManagerFactory::Delegate::GetCurrentTargetForAccelerator(
const ui::Accelerator& accelerator) const {
AcceleratorController* controller =
Shell::GetInstance()->accelerator_controller();
if (controller && controller->IsRegistered(accelerator))
return controller;
return NULL;
}
} // namespace ash
|