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

Side by Side Diff: ui/views/focus/focus_search.cc

Issue 10939010: Cleanup: avoid foo ? true : false, part 1. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/bubble/bubble_border.h ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_border.h ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698