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 #ifndef ASH_WM_ASH_FOCUS_RULES_H_ | 5 #ifndef ASH_WM_ASH_FOCUS_RULES_H_ |
6 #define ASH_WM_ASH_FOCUS_RULES_H_ | 6 #define ASH_WM_ASH_FOCUS_RULES_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/wm/core/base_focus_rules.h" | 11 #include "ui/wm/core/base_focus_rules.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 namespace wm { | 14 namespace wm { |
15 | 15 |
16 class ASH_EXPORT AshFocusRules : public ::wm::BaseFocusRules { | 16 class ASH_EXPORT AshFocusRules : public ::wm::BaseFocusRules { |
17 public: | 17 public: |
18 AshFocusRules(); | 18 AshFocusRules(); |
19 ~AshFocusRules() override; | 19 ~AshFocusRules() override; |
20 | 20 |
21 // Tests if the given |window| can be activated, ignoring the system modal | 21 // Set whether |window| should be activated on pointer. On Chrome OS, window |
sky
2017/04/12 19:49:16
pointer -> point events
Qiang(Joe) Xu
2017/04/12 23:00:41
Done.
| |
22 // dialog state. | 22 // can be activated from input event, such as mouse pressed or single point |
23 bool IsWindowConsideredActivatable(aura::Window* window) const; | 23 // gesture tap. If |activate_on_pointer| is false, we disable the default |
24 // activation rule for |window|. | |
sky
2017/04/12 19:49:16
Document what the default is.
Qiang(Joe) Xu
2017/04/12 23:00:41
Done.
| |
25 static void SetActivateOnPointer(aura::Window* window, | |
26 bool activate_on_pointer); | |
24 | 27 |
25 private: | 28 private: |
26 // ::wm::BaseFocusRules: | 29 // ::wm::BaseFocusRules: |
27 bool IsToplevelWindow(aura::Window* window) const override; | 30 bool IsToplevelWindow(aura::Window* window) const override; |
28 bool SupportsChildActivation(aura::Window* window) const override; | 31 bool SupportsChildActivation(aura::Window* window) const override; |
29 bool IsWindowConsideredVisibleForActivation( | 32 bool IsWindowConsideredVisibleForActivation( |
30 aura::Window* window) const override; | 33 aura::Window* window) const override; |
31 bool CanActivateWindow(aura::Window* window) const override; | 34 bool CanActivateWindow(aura::Window* window) const override; |
35 bool CanFocusWindow(aura::Window* window, ui::Event* event) const override; | |
32 aura::Window* GetNextActivatableWindow(aura::Window* ignore) const override; | 36 aura::Window* GetNextActivatableWindow(aura::Window* ignore) const override; |
33 | 37 |
34 aura::Window* GetTopmostWindowToActivateForContainerIndex( | 38 aura::Window* GetTopmostWindowToActivateForContainerIndex( |
35 int index, | 39 int index, |
36 aura::Window* ignore) const; | 40 aura::Window* ignore) const; |
37 aura::Window* GetTopmostWindowToActivateInContainer( | 41 aura::Window* GetTopmostWindowToActivateInContainer( |
38 aura::Window* container, | 42 aura::Window* container, |
39 aura::Window* ignore) const; | 43 aura::Window* ignore) const; |
40 | 44 |
41 DISALLOW_COPY_AND_ASSIGN(AshFocusRules); | 45 DISALLOW_COPY_AND_ASSIGN(AshFocusRules); |
42 }; | 46 }; |
43 | 47 |
44 } // namespace wm | 48 } // namespace wm |
45 } // namespace ash | 49 } // namespace ash |
46 | 50 |
47 #endif // ASH_WM_ASH_FOCUS_RULES_H_ | 51 #endif // ASH_WM_ASH_FOCUS_RULES_H_ |
OLD | NEW |