| 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/controls/menu/menu_controller.h" | 5 #include "ui/views/controls/menu/menu_controller.h" |
| 6 | 6 |
| 7 #include "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (deepest) | 101 if (deepest) |
| 102 return deepest; | 102 return deepest; |
| 103 } | 103 } |
| 104 } else { | 104 } else { |
| 105 for (int i = start == -1 ? view->child_count() - 1 : start; i >= 0; --i) { | 105 for (int i = start == -1 ? view->child_count() - 1 : start; i >= 0; --i) { |
| 106 View* deepest = GetFirstFocusableView(view->child_at(i), -1, forward); | 106 View* deepest = GetFirstFocusableView(view->child_at(i), -1, forward); |
| 107 if (deepest) | 107 if (deepest) |
| 108 return deepest; | 108 return deepest; |
| 109 } | 109 } |
| 110 } | 110 } |
| 111 return view->IsFocusableInRootView() ? view : NULL; | 111 return view->IsFocusable() ? view : NULL; |
| 112 } | 112 } |
| 113 | 113 |
| 114 // Returns the first child of |start| that is focusable. | 114 // Returns the first child of |start| that is focusable. |
| 115 static View* GetInitialFocusableView(View* start, bool forward) { | 115 static View* GetInitialFocusableView(View* start, bool forward) { |
| 116 return GetFirstFocusableView(start, -1, forward); | 116 return GetFirstFocusableView(start, -1, forward); |
| 117 } | 117 } |
| 118 | 118 |
| 119 // Returns the next view after |start_at| that is focusable. Returns NULL if | 119 // Returns the next view after |start_at| that is focusable. Returns NULL if |
| 120 // there are no focusable children of |ancestor| after |start_at|. | 120 // there are no focusable children of |ancestor| after |start_at|. |
| 121 static View* GetNextFocusableView(View* ancestor, | 121 static View* GetNextFocusableView(View* ancestor, |
| (...skipping 1831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 // is necessary to exit from nested loop (See Dispatch methods). | 1953 // is necessary to exit from nested loop (See Dispatch methods). |
| 1954 // Send non-op event so that Dispatch method will always be called. | 1954 // Send non-op event so that Dispatch method will always be called. |
| 1955 // crbug.com/104684. | 1955 // crbug.com/104684. |
| 1956 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) | 1956 if (exit_type_ == EXIT_ALL || exit_type_ == EXIT_DESTROYED) |
| 1957 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); | 1957 aura::RootWindow::GetInstance()->PostNativeEvent(ui::CreateNoopEvent()); |
| 1958 #endif | 1958 #endif |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 | 1961 |
| 1962 } // namespace views | 1962 } // namespace views |
| OLD | NEW |