| 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_FOCUS_FOCUS_MANAGER_H_ | 5 #ifndef UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
| 6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 // Get the reason why the focus most recently changed. | 178 // Get the reason why the focus most recently changed. |
| 179 FocusChangeReason focus_change_reason() const { | 179 FocusChangeReason focus_change_reason() const { |
| 180 return focus_change_reason_; | 180 return focus_change_reason_; |
| 181 } | 181 } |
| 182 | 182 |
| 183 // Clears the focused view. The window associated with the top root view gets | 183 // Clears the focused view. The window associated with the top root view gets |
| 184 // the native focus (so we still get keyboard events). | 184 // the native focus (so we still get keyboard events). |
| 185 void ClearFocus(); | 185 void ClearFocus(); |
| 186 | 186 |
| 187 // Clears the focused view if it has become unfocusable. |
| 188 void ClearFocusIfUnfocusable(); |
| 189 |
| 187 // Validates the focused view, clearing it if the window it belongs too is not | 190 // Validates the focused view, clearing it if the window it belongs too is not |
| 188 // attached to the window hierarchy anymore. | 191 // attached to the window hierarchy anymore. |
| 189 void ValidateFocusedView(); | 192 void ValidateFocusedView(); |
| 190 | 193 |
| 191 // Stores the focused view. Used when the widget loses activation. | 194 // Stores the focused view. Used when the widget loses activation. |
| 192 // |clear_native_focus| indicates whether this should invoke ClearFocus(). | 195 // |clear_native_focus| indicates whether this should invoke ClearFocus(). |
| 193 // Typically |true| should be passed in. | 196 // Typically |true| should be passed in. |
| 194 void StoreFocusedView(bool clear_native_focus); | 197 void StoreFocusedView(bool clear_native_focus); |
| 195 | 198 |
| 196 // Restore the view saved with a previous call to StoreFocusedView(). Used | 199 // Restore the view saved with a previous call to StoreFocusedView(). Used |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 | 366 |
| 364 // See description above getter. | 367 // See description above getter. |
| 365 bool is_changing_focus_; | 368 bool is_changing_focus_; |
| 366 | 369 |
| 367 DISALLOW_COPY_AND_ASSIGN(FocusManager); | 370 DISALLOW_COPY_AND_ASSIGN(FocusManager); |
| 368 }; | 371 }; |
| 369 | 372 |
| 370 } // namespace views | 373 } // namespace views |
| 371 | 374 |
| 372 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 375 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
| OLD | NEW |