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

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

Issue 2295183003: Update desktop tree when Aura windows are removed. (Closed)
Patch Set: 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..17ae66f365cd7d08df20ffeffb55d2547d82b045 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,11 @@ 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 of |window|. If parent of |window| does not exist, the root of
+ // the tree will be notified.
+ void Remove(aura::Window* window, bool notify);
// Removes a view and all of its descendants from the cache.
void RemoveViewSubtree(View* view);
@@ -76,6 +85,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 +128,8 @@ class VIEWS_EXPORT AXAuraObjCache
// True immediately when entering this object's destructor.
bool is_destroying_;
+ Delegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(AXAuraObjCache);
};

Powered by Google App Engine
This is Rietveld 408576698