| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 void SetFocusedViewWithReason(View* view, FocusChangeReason reason); | 161 void SetFocusedViewWithReason(View* view, FocusChangeReason reason); |
| 162 void SetFocusedView(View* view) { | 162 void SetFocusedView(View* view) { |
| 163 SetFocusedViewWithReason(view, kReasonDirectFocusChange); | 163 SetFocusedViewWithReason(view, kReasonDirectFocusChange); |
| 164 } | 164 } |
| 165 | 165 |
| 166 // Get the reason why the focus most recently changed. | 166 // Get the reason why the focus most recently changed. |
| 167 FocusChangeReason focus_change_reason() const { | 167 FocusChangeReason focus_change_reason() const { |
| 168 return focus_change_reason_; | 168 return focus_change_reason_; |
| 169 } | 169 } |
| 170 | 170 |
| 171 // Gets the AcceleratorManager this FocusManager is associated with. |
| 172 ui::AcceleratorManager* accelerator_manager() const { |
| 173 return accelerator_manager_.get(); |
| 174 } |
| 175 |
| 171 // Clears the focused view. The window associated with the top root view gets | 176 // Clears the focused view. The window associated with the top root view gets |
| 172 // the native focus (so we still get keyboard events). | 177 // the native focus (so we still get keyboard events). |
| 173 void ClearFocus(); | 178 void ClearFocus(); |
| 174 | 179 |
| 175 // Validates the focused view, clearing it if the window it belongs too is not | 180 // Validates the focused view, clearing it if the window it belongs too is not |
| 176 // attached to the window hierarchy anymore. | 181 // attached to the window hierarchy anymore. |
| 177 void ValidateFocusedView(); | 182 void ValidateFocusedView(); |
| 178 | 183 |
| 179 // Stores and restores the focused view. Used when the window becomes | 184 // Stores and restores the focused view. Used when the window becomes |
| 180 // active/inactive. | 185 // active/inactive. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 312 |
| 308 // See description above getter. | 313 // See description above getter. |
| 309 bool is_changing_focus_; | 314 bool is_changing_focus_; |
| 310 | 315 |
| 311 DISALLOW_COPY_AND_ASSIGN(FocusManager); | 316 DISALLOW_COPY_AND_ASSIGN(FocusManager); |
| 312 }; | 317 }; |
| 313 | 318 |
| 314 } // namespace views | 319 } // namespace views |
| 315 | 320 |
| 316 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 321 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
| OLD | NEW |