OLD | NEW |
---|---|
(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 | |
OLD | NEW |