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

Unified Diff: chrome/browser/ui/aura/accessibility/automation_manager_aura.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: chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
diff --git a/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc b/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
index c0de45ea7ab691ecf1d61069df35631d7e903f19..852d637b9464789b1649fcd571839c114249277d 100644
--- a/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
+++ b/chrome/browser/ui/aura/accessibility/automation_manager_aura.cc
@@ -17,7 +17,6 @@
#include "content/public/browser/ax_event_notification_details.h"
#include "content/public/browser/browser_context.h"
#include "ui/aura/window.h"
-#include "ui/views/accessibility/ax_aura_obj_cache.h"
#include "ui/views/accessibility/ax_aura_obj_wrapper.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
@@ -41,6 +40,7 @@ void AutomationManagerAura::Enable(BrowserContext* context) {
ResetSerializer();
SendEvent(context, current_tree_->GetRoot(), ui::AX_EVENT_LOAD_COMPLETE);
+ views::AXAuraObjCache::GetInstance()->SetDelegate(this);
#if defined(OS_CHROMEOS)
aura::Window* active_window = ash::wm::GetActiveWindow();
@@ -121,6 +121,27 @@ void AutomationManagerAura::ShowContextMenu(int32_t id) {
current_tree_->ShowContextMenu(id);
}
+void AutomationManagerAura::OnChildWindowRemoved(
+ views::AXAuraObjWrapper* parent) {
+ if (!enabled_)
+ return;
+
+ BrowserContext* context = nullptr;
+ if (g_browser_process->profile_manager()) {
+ context = g_browser_process->profile_manager()->GetLastUsedProfile();
dmazzoni 2016/08/31 16:33:50 This is done in two places. I think it'd be better
David Tseng 2016/08/31 21:06:42 Done.
+ }
+
+ if (!context) {
+ LOG(WARNING) << "Accessibility notification but no browser context";
+ return;
+ }
+
+ if (!parent)
+ parent = current_tree_->GetRoot();
+
+ SendEvent(context, parent, ui::AX_EVENT_CHILDREN_CHANGED);
+}
+
AutomationManagerAura::AutomationManagerAura()
: enabled_(false), processing_events_(false) {}

Powered by Google App Engine
This is Rietveld 408576698