OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SERVICES_WINDOW_MANAGER_FOCUS_CONTROLLER_OBSERVER_H_ | 5 #ifndef SERVICES_WINDOW_MANAGER_FOCUS_CONTROLLER_OBSERVER_H_ |
6 #define SERVICES_WINDOW_MANAGER_FOCUS_CONTROLLER_OBSERVER_H_ | 6 #define SERVICES_WINDOW_MANAGER_FOCUS_CONTROLLER_OBSERVER_H_ |
7 | 7 |
8 namespace mojo { | 8 namespace mojo { |
| 9 class View; |
| 10 } |
9 | 11 |
10 class View; | 12 namespace window_manager { |
11 | 13 |
12 class FocusControllerObserver { | 14 class FocusControllerObserver { |
13 public: | 15 public: |
14 // Called when |active| gains focus, or there is no active view | 16 // Called when |active| gains focus, or there is no active view |
15 // (|active| is null in this case.) |old_active| refers to the | 17 // (|active| is null in this case.) |old_active| refers to the |
16 // previous active view or null if there was no previously active | 18 // previous active view or null if there was no previously active |
17 // view. | 19 // view. |
18 virtual void OnViewActivated(View* gained_active, | 20 virtual void OnViewActivated(mojo::View* gained_active, |
19 View* lost_active) = 0; | 21 mojo::View* lost_active) = 0; |
20 | 22 |
21 // Called when focus moves from |lost_focus| to |gained_focus|. | 23 // Called when focus moves from |lost_focus| to |gained_focus|. |
22 virtual void OnViewFocused(View* gained_focus, View* lost_focus) = 0; | 24 virtual void OnViewFocused(mojo::View* gained_focus, |
| 25 mojo::View* lost_focus) = 0; |
23 | 26 |
24 // Called when during view activation the currently active view is | 27 // Called when during view activation the currently active view is |
25 // selected for activation. This can happen when a view requested for | 28 // selected for activation. This can happen when a view requested for |
26 // activation cannot be activated because a system modal view is active. | 29 // activation cannot be activated because a system modal view is active. |
27 virtual void OnAttemptToReactivateView(View* request_active, | 30 virtual void OnAttemptToReactivateView(mojo::View* request_active, |
28 View* actual_active) {} | 31 mojo::View* actual_active) {} |
29 | 32 |
30 protected: | 33 protected: |
31 virtual ~FocusControllerObserver() {} | 34 virtual ~FocusControllerObserver() {} |
32 }; | 35 }; |
33 | 36 |
34 } // namespace mojo | 37 } // namespace window_manager |
35 | 38 |
36 #endif // SERVICES_WINDOW_MANAGER_FOCUS_CONTROLLER_OBSERVER_H_ | 39 #endif // SERVICES_WINDOW_MANAGER_FOCUS_CONTROLLER_OBSERVER_H_ |
OLD | NEW |