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

Side by Side Diff: ash/accelerators/focus_manager_factory.cc

Issue 10134036: Let Chrome app handle Ash accelerators first if the app is launched as a window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: final rebase Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/accelerators/focus_manager_factory.h ('k') | ash/ash.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/accelerators/focus_manager_factory.h"
6
7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/shell.h"
9 #include "ui/views/focus/focus_manager.h"
10
11 namespace ash {
12
13 AshFocusManagerFactory::AshFocusManagerFactory() {}
14 AshFocusManagerFactory::~AshFocusManagerFactory() {}
15
16 views::FocusManager* AshFocusManagerFactory::CreateFocusManager(
17 views::Widget* widget) {
18 return new views::FocusManager(widget, new Delegate);
19 }
20
21 bool AshFocusManagerFactory::Delegate::ProcessAccelerator(
22 const ui::Accelerator& accelerator) {
23 AcceleratorController* controller =
24 Shell::GetInstance()->accelerator_controller();
25 if (controller)
26 return controller->Process(accelerator);
27 return false;
28 }
29
30 ui::AcceleratorTarget*
31 AshFocusManagerFactory::Delegate::GetCurrentTargetForAccelerator(
32 const ui::Accelerator& accelerator) const {
33 AcceleratorController* controller =
34 Shell::GetInstance()->accelerator_controller();
35 if (controller && controller->IsRegistered(accelerator))
36 return controller;
37 return NULL;
38 }
39
40 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/focus_manager_factory.h ('k') | ash/ash.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698