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 "base/logging.h" | 5 #include "base/logging.h" |
6 #include "ui/views/focus/focus_manager.h" | 6 #include "ui/views/focus/focus_manager.h" |
7 #include "ui/views/focus/focus_search.h" | 7 #include "ui/views/focus/focus_search.h" |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 check_starting_view = true; | 44 check_starting_view = true; |
45 } else { | 45 } else { |
46 // The starting view should be a direct or indirect child of the root. | 46 // The starting view should be a direct or indirect child of the root. |
47 DCHECK(Contains(root_, starting_view)); | 47 DCHECK(Contains(root_, starting_view)); |
48 } | 48 } |
49 | 49 |
50 View* v = NULL; | 50 View* v = NULL; |
51 if (!reverse) { | 51 if (!reverse) { |
52 v = FindNextFocusableViewImpl(starting_view, check_starting_view, | 52 v = FindNextFocusableViewImpl(starting_view, check_starting_view, |
53 true, | 53 true, |
54 (direction == DOWN) ? true : false, | 54 (direction == DOWN), |
55 starting_view_group, | 55 starting_view_group, |
56 focus_traversable, | 56 focus_traversable, |
57 focus_traversable_view); | 57 focus_traversable_view); |
58 } else { | 58 } else { |
59 // If the starting view is focusable, we don't want to go down, as we are | 59 // If the starting view is focusable, we don't want to go down, as we are |
60 // traversing the view hierarchy tree bottom-up. | 60 // traversing the view hierarchy tree bottom-up. |
61 bool can_go_down = (direction == DOWN) && !IsFocusable(starting_view); | 61 bool can_go_down = (direction == DOWN) && !IsFocusable(starting_view); |
62 v = FindPreviousFocusableViewImpl(starting_view, check_starting_view, | 62 v = FindPreviousFocusableViewImpl(starting_view, check_starting_view, |
63 true, | 63 true, |
64 can_go_down, | 64 can_go_down, |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 skip_group_id, | 266 skip_group_id, |
267 focus_traversable, | 267 focus_traversable, |
268 focus_traversable_view); | 268 focus_traversable_view); |
269 } | 269 } |
270 | 270 |
271 // We found nothing. | 271 // We found nothing. |
272 return NULL; | 272 return NULL; |
273 } | 273 } |
274 | 274 |
275 } // namespace views | 275 } // namespace views |
OLD | NEW |