Index: ui/views/view.cc |
diff --git a/ui/views/view.cc b/ui/views/view.cc |
index 349b0ddbcaa5d9b8ae97176ad97076c36e14eb01..8316afb05f2eaf52b0dc74e2a47edb717b9417be 100644 |
--- a/ui/views/view.cc |
+++ b/ui/views/view.cc |
@@ -406,6 +406,7 @@ void View::SetVisible(bool visible) { |
SchedulePaint(); |
visible_ = visible; |
+ ReviseFocusedView(); |
// Notify the parent. |
if (parent_) |
@@ -428,6 +429,7 @@ bool View::IsDrawn() const { |
void View::SetEnabled(bool enabled) { |
if (enabled != enabled_) { |
enabled_ = enabled; |
+ ReviseFocusedView(); |
OnEnabledChanged(); |
} |
} |
@@ -1144,6 +1146,7 @@ void View::SetFocusable(bool focusable) { |
return; |
focusable_ = focusable; |
+ ReviseFocusedView(); |
} |
bool View::IsFocusable() const { |
@@ -1159,6 +1162,7 @@ void View::SetAccessibilityFocusable(bool accessibility_focusable) { |
return; |
accessibility_focusable_ = accessibility_focusable; |
+ ReviseFocusedView(); |
} |
FocusManager* View::GetFocusManager() { |
@@ -2371,6 +2375,12 @@ void View::InitFocusSiblings(View* v, int index) { |
} |
} |
+void View::ReviseFocusedView() { |
+ FocusManager* focus_manager = GetFocusManager(); |
sky
2014/08/07 21:40:34
I would rather avoid the constant tree walking if
mohsen
2014/08/08 01:32:07
Yep, done.
|
+ if (focus_manager) |
+ focus_manager->ReviseFocusedView(); |
+} |
+ |
// System events --------------------------------------------------------------- |
void View::PropagateThemeChanged() { |