| 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 #include <memory> | 10 #include <memory> |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // This interface should be implemented by classes that want to be notified when | 112 // This interface should be implemented by classes that want to be notified when |
| 113 // the focus is about to change. See the Add/RemoveFocusChangeListener methods. | 113 // the focus is about to change. See the Add/RemoveFocusChangeListener methods. |
| 114 class VIEWS_EXPORT FocusChangeListener { | 114 class VIEWS_EXPORT FocusChangeListener { |
| 115 public: | 115 public: |
| 116 // No change to focus state has occurred yet when this function is called. | 116 // No change to focus state has occurred yet when this function is called. |
| 117 virtual void OnWillChangeFocus(View* focused_before, View* focused_now) = 0; | 117 virtual void OnWillChangeFocus(View* focused_before, View* focused_now) = 0; |
| 118 | 118 |
| 119 // Called after focus state has changed. | 119 // Called after focus state has changed. |
| 120 virtual void OnDidChangeFocus(View* focused_before, View* focused_now) = 0; | 120 virtual void OnDidChangeFocus(View* focused_before, View* focused_now) = 0; |
| 121 | 121 |
| 122 virtual void OnFocusManagerDestroying() {} |
| 123 |
| 122 protected: | 124 protected: |
| 123 virtual ~FocusChangeListener() {} | 125 virtual ~FocusChangeListener() {} |
| 124 }; | 126 }; |
| 125 | 127 |
| 126 class VIEWS_EXPORT FocusManager { | 128 class VIEWS_EXPORT FocusManager { |
| 127 public: | 129 public: |
| 128 // The reason why the focus changed. | 130 // The reason why the focus changed. |
| 129 enum FocusChangeReason { | 131 enum FocusChangeReason { |
| 130 // The focus changed because the user traversed focusable views using | 132 // The focus changed because the user traversed focusable views using |
| 131 // keys like Tab or Shift+Tab. | 133 // keys like Tab or Shift+Tab. |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 // access is enabled. | 385 // access is enabled. |
| 384 // Default value is false. | 386 // Default value is false. |
| 385 bool keyboard_accessible_; | 387 bool keyboard_accessible_; |
| 386 | 388 |
| 387 DISALLOW_COPY_AND_ASSIGN(FocusManager); | 389 DISALLOW_COPY_AND_ASSIGN(FocusManager); |
| 388 }; | 390 }; |
| 389 | 391 |
| 390 } // namespace views | 392 } // namespace views |
| 391 | 393 |
| 392 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ | 394 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_H_ |
| OLD | NEW |