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

Unified Diff: views/view.cc

Issue 2935005: Prevent non-visible views from getting focused. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix nit Created 10 years, 5 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
« no previous file with comments | « views/focus/focus_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.cc
diff --git a/views/view.cc b/views/view.cc
index d3a9b982c70bc0d87707743498123d6c0912a09f..69cf67f8aee03392a74d81bde2621d64bff5471e 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -264,7 +264,7 @@ void View::SetEnabled(bool state) {
}
bool View::IsFocusable() const {
- return focusable_ && IsEnabled() && IsVisible();
+ return focusable_ && IsEnabled() && IsVisibleInRootView();
}
void View::SetFocusable(bool focusable) {
@@ -272,7 +272,8 @@ void View::SetFocusable(bool focusable) {
}
bool View::IsAccessibilityFocusable() const {
- return (focusable_ || accessibility_focusable_) && IsEnabled() && IsVisible();
+ return (focusable_ || accessibility_focusable_) && IsEnabled() &&
+ IsVisibleInRootView();
}
FocusManager* View::GetFocusManager() {
« no previous file with comments | « views/focus/focus_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698