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

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

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.cc
diff --git a/ui/views/accessibility/ax_aura_obj_cache.cc b/ui/views/accessibility/ax_aura_obj_cache.cc
index 28162c3092e9aed129ebf9c9e096bd799cc432fa..7107da3f07ca7b7e426bc84980e16aa555972f76 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.cc
+++ b/ui/views/accessibility/ax_aura_obj_cache.cc
@@ -74,8 +74,19 @@ void AXAuraObjCache::Remove(Widget* widget) {
RemoveViewSubtree(widget->GetRootView());
}
-void AXAuraObjCache::Remove(aura::Window* window) {
+void AXAuraObjCache::Remove(aura::Window* window, bool notify) {
+ int id = GetIDInternal(window, window_to_id_map_);
+ AXAuraObjWrapper* obj = nullptr;
+ if (id != -1) {
dmazzoni 2016/08/31 16:33:50 This check isn't necessary, right? You can still c
David Tseng 2016/08/31 21:06:42 Done.
+ obj = Get(id);
+ if (obj)
+ obj = obj->GetParent();
+ }
+
RemoveInternal(window, window_to_id_map_);
+
+ if (notify && delegate_)
+ delegate_->OnChildWindowRemoved(obj);
}
AXAuraObjWrapper* AXAuraObjCache::Get(int32_t id) {
@@ -117,8 +128,8 @@ AXAuraObjWrapper* AXAuraObjCache::GetFocus() {
AXAuraObjCache::AXAuraObjCache()
: current_id_(1),
focus_client_(nullptr),
- is_destroying_(false) {
-}
+ is_destroying_(false),
+ delegate_(nullptr) {}
AXAuraObjCache::~AXAuraObjCache() {
is_destroying_ = true;

Powered by Google App Engine
This is Rietveld 408576698