Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1515)

Unified Diff: ui/views/focus/focus_manager.cc

Issue 838253004: MacViews: Fix duplicate definition of ExtensionKeyBindingRegistry::SetShortcutHandlingSuspended (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@DragBookmarks2
Patch Set: Use callback Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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.

Powered by Google App Engine
This is Rietveld 408576698