Chromium Code Reviews| Index: ui/views/focus/focus_manager.h |
| diff --git a/ui/views/focus/focus_manager.h b/ui/views/focus/focus_manager.h |
| index 02fe0abb7000db6d3cd78ebd39ad71fe0ab50136..a3f22891fc02eddd1ee3a7bf20bb5ca9741afa6b 100644 |
| --- a/ui/views/focus/focus_manager.h |
| +++ b/ui/views/focus/focus_manager.h |
| @@ -10,6 +10,7 @@ |
| #include "base/macros.h" |
| #include "base/observer_list.h" |
| #include "ui/base/accelerators/accelerator_manager.h" |
| +#include "ui/views/view_observer.h" |
| #include "ui/views/views_export.h" |
| // FocusManager handles focus traversal, stores and restores focused views, and |
| @@ -70,6 +71,11 @@ |
| // Note that FocusTraversable views do not have to be RootViews: |
| // AccessibleToolbarView is FocusTraversable. |
| +namespace base { |
| +namespace debug { |
| +class StackTrace; |
| +} |
| +} |
| namespace ui { |
|
msw
2017/03/13 18:22:16
nit: blank line above
|
| class Accelerator; |
| class AcceleratorTarget; |
| @@ -118,7 +124,8 @@ class VIEWS_EXPORT FocusChangeListener { |
| virtual ~FocusChangeListener() {} |
| }; |
| -class VIEWS_EXPORT FocusManager { |
| +// FocusManager adds itself as a ViewObserver to the currently focused view. |
| +class VIEWS_EXPORT FocusManager : public ViewObserver { |
| public: |
| // The reason why the focus changed. |
| enum FocusChangeReason { |
| @@ -146,7 +153,7 @@ class VIEWS_EXPORT FocusManager { |
| }; |
| FocusManager(Widget* widget, std::unique_ptr<FocusManagerDelegate> delegate); |
| - virtual ~FocusManager(); |
| + ~FocusManager() override; |
| // Processes the passed key event for accelerators and keyboard traversal. |
| // Returns false if the event has been consumed and should not be processed |
| @@ -331,6 +338,9 @@ class VIEWS_EXPORT FocusManager { |
| // of |keyboard_accesible_|. |
| bool IsFocusable(View* view) const; |
| + // ViewObserver: |
| + void OnViewIsDeleting(View* view) override; |
| + |
| // Whether arrow key traversal is enabled. |
| static bool arrow_key_traversal_enabled_; |
| @@ -344,6 +354,9 @@ class VIEWS_EXPORT FocusManager { |
| // The view that currently is focused. |
| View* focused_view_ = nullptr; |
| + // TODO(sky): remove, used for debugging 687232. |
| + std::unique_ptr<base::debug::StackTrace> stack_when_focused_view_set_; |
| + |
| // The AcceleratorManager this FocusManager is associated with. |
| ui::AcceleratorManager accelerator_manager_; |