| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/accessible_pane_view.h" | 5 #include "ui/views/accessible_pane_view.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
| 9 #include "ui/views/focus/focus_search.h" | 9 #include "ui/views/focus/focus_search.h" |
| 10 #include "ui/views/focus/view_storage.h" | 10 #include "ui/views/focus/view_storage.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 if (!focus_manager_) | 37 if (!focus_manager_) |
| 38 focus_manager_ = GetFocusManager(); | 38 focus_manager_ = GetFocusManager(); |
| 39 | 39 |
| 40 focus_manager_->StoreFocusedView(); | 40 focus_manager_->StoreFocusedView(); |
| 41 | 41 |
| 42 // Use the provided initial focus if it's visible and enabled, otherwise | 42 // Use the provided initial focus if it's visible and enabled, otherwise |
| 43 // use the first focusable child. | 43 // use the first focusable child. |
| 44 if (!initial_focus || | 44 if (!initial_focus || |
| 45 !Contains(initial_focus) || | 45 !Contains(initial_focus) || |
| 46 !initial_focus->IsVisible() || | 46 !initial_focus->IsVisible() || |
| 47 !initial_focus->IsEnabled()) { | 47 !initial_focus->enabled()) { |
| 48 initial_focus = GetFirstFocusableChild(); | 48 initial_focus = GetFirstFocusableChild(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 // Return false if there are no focusable children. | 51 // Return false if there are no focusable children. |
| 52 if (!initial_focus) | 52 if (!initial_focus) |
| 53 return false; | 53 return false; |
| 54 | 54 |
| 55 focus_manager_->SetFocusedView(initial_focus); | 55 focus_manager_->SetFocusedView(initial_focus); |
| 56 | 56 |
| 57 // If we already have pane focus, we're done. | 57 // If we already have pane focus, we're done. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 DCHECK(pane_has_focus_); | 196 DCHECK(pane_has_focus_); |
| 197 return NULL; | 197 return NULL; |
| 198 } | 198 } |
| 199 | 199 |
| 200 views::View* AccessiblePaneView::GetFocusTraversableParentView() { | 200 views::View* AccessiblePaneView::GetFocusTraversableParentView() { |
| 201 DCHECK(pane_has_focus_); | 201 DCHECK(pane_has_focus_); |
| 202 return NULL; | 202 return NULL; |
| 203 } | 203 } |
| 204 | 204 |
| 205 } // namespace views | 205 } // namespace views |
| OLD | NEW |