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

Unified Diff: ui/views/accessibility/ax_aura_obj_cache.h

Issue 1705853002: NOT FOR REVIEW. ax tree focus with debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash Created 4 years, 10 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
« no previous file with comments | « ui/app_list/views/search_result_actions_view.cc ('k') | ui/views/accessibility/ax_aura_obj_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « ui/app_list/views/search_result_actions_view.cc ('k') | ui/views/accessibility/ax_aura_obj_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698