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

Side by Side Diff: ash/wm/ash_focus_rules.cc

Issue 11414252: Add focus rules for Ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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/wm/ash_focus_rules.h ('k') | no next file » | 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/wm/ash_focus_rules.h"
6
7 #include "ui/aura/window.h"
8
9 namespace ash {
10 namespace wm {
11
12 ////////////////////////////////////////////////////////////////////////////////
13 // AshFocusRules, public:
14
15 AshFocusRules::AshFocusRules() {
16 }
17
18 AshFocusRules::~AshFocusRules() {
19 }
20
21 ////////////////////////////////////////////////////////////////////////////////
22 // AshFocusRules, views::corewm::FocusRules:
23
24 bool AshFocusRules::CanActivateWindow(aura::Window* window) {
25 return !!window->parent();
26 }
27
28 bool AshFocusRules::CanFocusWindow(aura::Window* window) {
29 aura::Window* activatable = GetActivatableWindow(window);
30 return activatable->Contains(window) && window->CanFocus();
sadrul 2012/11/30 17:10:13 Can |activatable| (or |window|) be NULL?
31 }
32
33 aura::Window* AshFocusRules::GetActivatableWindow(aura::Window* window) {
34 return window;
35 }
36
37 aura::Window* AshFocusRules::GetFocusableWindow(aura::Window* window) {
38 return window;
39 }
40
41 aura::Window* AshFocusRules::GetNextActivatableWindow(aura::Window* ignore) {
42 return NULL;
43 }
44
45 aura::Window* AshFocusRules::GetNextFocusableWindow(aura::Window* ignore) {
46 return GetFocusableWindow(ignore->parent());
47 }
48
49 } // namespace wm
50 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/ash_focus_rules.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698