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