Chromium Code Reviews| Index: ui/views/focus/focus_manager.cc |
| diff --git a/ui/views/focus/focus_manager.cc b/ui/views/focus/focus_manager.cc |
| index 706b3182721dcafe37b86665445094ac5a4d283a..aa5ef7df73804cee39043b944d6a4e26cc39bbc2 100644 |
| --- a/ui/views/focus/focus_manager.cc |
| +++ b/ui/views/focus/focus_manager.cc |
| @@ -44,7 +44,6 @@ static inline int CalculateModifiers(const ui::KeyEvent& event) { |
| } // namespace |
| -bool FocusManager::shortcut_handling_suspended_ = false; |
| bool FocusManager::arrow_key_traversal_enabled_ = false; |
| FocusManager::FocusManager(Widget* widget, FocusManagerDelegate* delegate) |
| @@ -52,6 +51,7 @@ FocusManager::FocusManager(Widget* widget, FocusManagerDelegate* delegate) |
| delegate_(delegate), |
| focused_view_(NULL), |
| accelerator_manager_(new ui::AcceleratorManager), |
| + shortcut_handling_suspended_callback_(nullptr), |
| focus_change_reason_(kReasonDirectFocusChange), |
| is_changing_focus_(false) { |
| DCHECK(widget_); |
| @@ -502,6 +502,17 @@ void FocusManager::BlurTextInputClient(View* view) { |
| BlurTextInputClient(text_input_client); |
| } |
| +void FocusManager::set_shortcut_handling_suspended_callback( |
| + ReturnBoolCallback* callback) { |
| + shortcut_handling_suspended_callback_ = callback; |
| +} |
| + |
| +bool FocusManager::shortcut_handling_suspended() const { |
| + if (!shortcut_handling_suspended_callback_) |
|
Devlin
2015/01/14 21:55:18
nit: if this stays, it can be simplified to
return
|
| + return false; |
| + return shortcut_handling_suspended_callback_->Run(); |
| +} |
| + |
| // Find the next (previous if reverse is true) focusable view for the specified |
| // FocusTraversable, starting at the specified view, traversing down the |
| // FocusTraversable hierarchy. |