| 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 UI_VIEWS_COREWM_FOCUS_CONTROLLER_H_ | 5 #ifndef UI_VIEWS_COREWM_FOCUS_CONTROLLER_H_ |
| 6 #define UI_VIEWS_COREWM_FOCUS_CONTROLLER_H_ | 6 #define UI_VIEWS_COREWM_FOCUS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/scoped_observer.h" | 9 #include "base/scoped_observer.h" |
| 10 #include "ui/aura/client/activation_client.h" | 10 #include "ui/aura/client/activation_client.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 // Overridden from aura::WindowObserver: | 78 // Overridden from aura::WindowObserver: |
| 79 virtual void OnWindowVisibilityChanged(aura::Window* window, | 79 virtual void OnWindowVisibilityChanged(aura::Window* window, |
| 80 bool visible) OVERRIDE; | 80 bool visible) OVERRIDE; |
| 81 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; | 81 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE; |
| 82 virtual void OnWindowHierarchyChanging( | 82 virtual void OnWindowHierarchyChanging( |
| 83 const HierarchyChangeParams& params) OVERRIDE; | 83 const HierarchyChangeParams& params) OVERRIDE; |
| 84 virtual void OnWindowHierarchyChanged( | 84 virtual void OnWindowHierarchyChanged( |
| 85 const HierarchyChangeParams& params) OVERRIDE; | 85 const HierarchyChangeParams& params) OVERRIDE; |
| 86 | 86 |
| 87 // Internal implementations that set the focused/active windows, fire events | 87 // Internal implementation that sets the focused window, fires events etc. |
| 88 // etc. These functions must be called with valid focusable/activatable | 88 // This function must be called with a valid focusable window. |
| 89 // windows. | |
| 90 void SetFocusedWindow(aura::Window* window); | 89 void SetFocusedWindow(aura::Window* window); |
| 91 void SetActiveWindow(aura::Window* window); | 90 |
| 91 // Internal implementation that sets the active window, fires events etc. |
| 92 // This function must be called with a valid |activatable_window|. |
| 93 // |requested window| refers to the window that was passed in to an external |
| 94 // request (e.g. FocusWindow or ActivateWindow). It may be NULL, e.g. if |
| 95 // SetActiveWindow was not called by an external request. |activatable_window| |
| 96 // refers to the actual window to be activated, which may be different. |
| 97 void SetActiveWindow(aura::Window* requested_window, |
| 98 aura::Window* activatable_window); |
| 92 | 99 |
| 93 // Called when a window's disposition changed such that it and its hierarchy | 100 // Called when a window's disposition changed such that it and its hierarchy |
| 94 // are no longer focusable/activatable. |next| is a valid window that is used | 101 // are no longer focusable/activatable. |next| is a valid window that is used |
| 95 // as a starting point for finding a window to focus next based on rules. | 102 // as a starting point for finding a window to focus next based on rules. |
| 96 void WindowLostFocusFromDispositionChange(aura::Window* window, | 103 void WindowLostFocusFromDispositionChange(aura::Window* window, |
| 97 aura::Window* next); | 104 aura::Window* next); |
| 98 | 105 |
| 99 // Called when an attempt is made to focus or activate a window via an input | 106 // Called when an attempt is made to focus or activate a window via an input |
| 100 // event targeted at that window. Rules determine the best focusable window | 107 // event targeted at that window. Rules determine the best focusable window |
| 101 // for the input window. | 108 // for the input window. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 114 | 121 |
| 115 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 122 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
| 116 | 123 |
| 117 DISALLOW_COPY_AND_ASSIGN(FocusController); | 124 DISALLOW_COPY_AND_ASSIGN(FocusController); |
| 118 }; | 125 }; |
| 119 | 126 |
| 120 } // namespace corewm | 127 } // namespace corewm |
| 121 } // namespace views | 128 } // namespace views |
| 122 | 129 |
| 123 #endif // UI_VIEWS_COREWM_FOCUS_CONTROLLER_H_ | 130 #endif // UI_VIEWS_COREWM_FOCUS_CONTROLLER_H_ |
| OLD | NEW |