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

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

Issue 2530073002: Add kAccessibilityFocusFallsbackToWidget property (Closed)
Patch Set: Fix AxAuraObjCache Created 4 years 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/aura/client/aura_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0ce0047c9987815064f5f795ccbb317198d53528..46043362945b42bdbc7ceda1a2be08307e2c8396 100644
--- a/ui/views/accessibility/ax_aura_obj_cache.cc
+++ b/ui/views/accessibility/ax_aura_obj_cache.cc
@@ -6,6 +6,8 @@
#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
+#include "base/strings/string_util.h"
+#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/focus_client.h"
#include "ui/aura/window.h"
#include "ui/views/accessibility/ax_aura_obj_wrapper.h"
@@ -160,8 +162,14 @@ View* AXAuraObjCache::GetFocusedView() {
View* focused_view = focus_manager->GetFocusedView();
if (focused_view)
return focused_view;
- else
+
+ if (focused_window->GetProperty(
+ aura::client::kAccessibilityFocusFallsbackToWidgetKey)) {
+ // If no view is focused, falls back to root view.
return focused_widget->GetRootView();
+ } else {
sky 2016/12/08 16:07:18 chromium style is no else after a return
yawano 2016/12/09 01:40:00 Done.
+ return nullptr;
+ }
}
void AXAuraObjCache::OnWindowFocused(aura::Window* gained_focus,
« no previous file with comments | « ui/aura/client/aura_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698