Index: ui/views/accessibility/ax_aura_obj_cache.h |
diff --git a/ui/views/accessibility/ax_aura_obj_cache.h b/ui/views/accessibility/ax_aura_obj_cache.h |
index 1129c1d237a8dde51e796c9bcc57eb4f122db7be..1e54de78e1971258c190cfc6fc7ac1b0bac1e43e 100644 |
--- a/ui/views/accessibility/ax_aura_obj_cache.h |
+++ b/ui/views/accessibility/ax_aura_obj_cache.h |
@@ -11,6 +11,7 @@ |
#include <vector> |
#include "base/macros.h" |
+#include "ui/aura/client/focus_change_observer.h" |
#include "ui/views/views_export.h" |
namespace base { |
@@ -18,6 +19,9 @@ template <typename T> struct DefaultSingletonTraits; |
} |
namespace aura { |
+namespace client { |
+class FocusClient; |
+} |
class Window; |
} // namespace aura |
@@ -27,7 +31,8 @@ class View; |
class Widget; |
// A cache responsible for assigning id's to a set of interesting Aura views. |
-class VIEWS_EXPORT AXAuraObjCache { |
+class VIEWS_EXPORT AXAuraObjCache |
+ : public aura::client::FocusChangeObserver { |
public: |
// Get the single instance of this class. |
static AXAuraObjCache* GetInstance(); |
@@ -63,6 +68,9 @@ class VIEWS_EXPORT AXAuraObjCache { |
// Get all top level windows this cache knows about. |
void GetTopLevelWindows(std::vector<AXAuraObjWrapper*>* children); |
+ // Get the object that has focus. |
+ AXAuraObjWrapper* GetFocus(); |
+ |
// Indicates if this object's currently being destroyed. |
bool is_destroying() { return is_destroying_; } |
@@ -70,7 +78,13 @@ class VIEWS_EXPORT AXAuraObjCache { |
friend struct base::DefaultSingletonTraits<AXAuraObjCache>; |
AXAuraObjCache(); |
- virtual ~AXAuraObjCache(); |
+ ~AXAuraObjCache() override; |
+ |
+ View* GetFocusedView(); |
+ |
+ // aura::client::FocusChangeObserver override. |
+ void OnWindowFocused(aura::Window* gained_focus, |
+ aura::Window* lost_focus) override; |
template <typename AuraViewWrapper, typename AuraView> |
AXAuraObjWrapper* CreateInternal( |
@@ -93,6 +107,8 @@ class VIEWS_EXPORT AXAuraObjCache { |
std::map<int32_t, AXAuraObjWrapper*> cache_; |
int32_t current_id_; |
+ aura::client::FocusClient* focus_client_; |
+ |
// True immediately when entering this object's destructor. |
bool is_destroying_; |