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 "views/view.h" | 5 #include "views/view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 1741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1752 accelerators_->clear(); | 1752 accelerators_->clear(); |
1753 accelerators_.reset(); | 1753 accelerators_.reset(); |
1754 } | 1754 } |
1755 registered_accelerator_count_ = 0; | 1755 registered_accelerator_count_ = 0; |
1756 } | 1756 } |
1757 } | 1757 } |
1758 | 1758 |
1759 // Focus ----------------------------------------------------------------------- | 1759 // Focus ----------------------------------------------------------------------- |
1760 | 1760 |
1761 void View::InitFocusSiblings(View* v, int index) { | 1761 void View::InitFocusSiblings(View* v, int index) { |
1762 int child_count = static_cast<int>(children_.size()); | 1762 int child_count = child_count(); |
1763 | 1763 |
1764 if (child_count == 0) { | 1764 if (child_count == 0) { |
1765 v->next_focusable_view_ = NULL; | 1765 v->next_focusable_view_ = NULL; |
1766 v->previous_focusable_view_ = NULL; | 1766 v->previous_focusable_view_ = NULL; |
1767 } else { | 1767 } else { |
1768 if (index == child_count) { | 1768 if (index == child_count) { |
1769 // We are inserting at the end, but the end of the child list may not be | 1769 // We are inserting at the end, but the end of the child list may not be |
1770 // the last focusable element. Let's try to find an element with no next | 1770 // the last focusable element. Let's try to find an element with no next |
1771 // focusable element to link to. | 1771 // focusable element to link to. |
1772 View* last_focusable_view = NULL; | 1772 View* last_focusable_view = NULL; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 result.append(GetChildViewAt(i)->PrintViewGraph(false)); | 1895 result.append(GetChildViewAt(i)->PrintViewGraph(false)); |
1896 | 1896 |
1897 if (first) | 1897 if (first) |
1898 result.append("}\n"); | 1898 result.append("}\n"); |
1899 | 1899 |
1900 return result; | 1900 return result; |
1901 } | 1901 } |
1902 #endif | 1902 #endif |
1903 | 1903 |
1904 } // namespace views | 1904 } // namespace views |
OLD | NEW |