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

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

Issue 2295183003: Update desktop tree when Aura windows are removed. (Closed)
Patch Set: Fix test. Created 4 years, 4 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/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 763f8f99171fbcdb37cebf07ffb3a66e82258e4d..321b4162184468be149afe39bce2b52e1740b5b7 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.h
+++ b/ui/views/accessibility/ax_aura_obj_cache.h
@@ -39,6 +39,11 @@ class VIEWS_EXPORT AXAuraObjCache
// Get the single instance of this class.
static AXAuraObjCache* GetInstance();
+ class Delegate {
+ public:
+ virtual void OnChildWindowRemoved(AXAuraObjWrapper* parent) = 0;
+ };
+
// Get or create an entry in the cache based on an Aura view.
AXAuraObjWrapper* GetOrCreate(View* view);
AXAuraObjWrapper* GetOrCreate(Widget* widget);
@@ -56,7 +61,10 @@ class VIEWS_EXPORT AXAuraObjCache
// Removes an entry from this cache based on an Aura view.
void Remove(View* view);
void Remove(Widget* widget);
- void Remove(aura::Window* window);
+
+ // Removes |window| and optionally notifies delegate by sending an event on
+ // the |parent| if provided.
+ void Remove(aura::Window* window, aura::Window* parent);
// Removes a view and all of its descendants from the cache.
void RemoveViewSubtree(View* view);
@@ -76,6 +84,8 @@ class VIEWS_EXPORT AXAuraObjCache
// Indicates if this object's currently being destroyed.
bool is_destroying() { return is_destroying_; }
+ void SetDelegate(Delegate* delegate) { delegate_ = delegate; }
+
private:
friend struct base::DefaultSingletonTraits<AXAuraObjCache>;
@@ -117,6 +127,8 @@ class VIEWS_EXPORT AXAuraObjCache
// True immediately when entering this object's destructor.
bool is_destroying_;
+ Delegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(AXAuraObjCache);
};
« no previous file with comments | « chrome/browser/ui/aura/accessibility/automation_manager_aura.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