OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // SubmenuView being scrolled. | 201 // SubmenuView being scrolled. |
202 SubmenuView* submenu_; | 202 SubmenuView* submenu_; |
203 | 203 |
204 // Direction scrolling. | 204 // Direction scrolling. |
205 bool is_scrolling_up_; | 205 bool is_scrolling_up_; |
206 | 206 |
207 // Timer to periodically scroll. | 207 // Timer to periodically scroll. |
208 base::RepeatingTimer<MenuScrollTask> scrolling_timer_; | 208 base::RepeatingTimer<MenuScrollTask> scrolling_timer_; |
209 | 209 |
210 // Time we started scrolling at. | 210 // Time we started scrolling at. |
211 Time start_scroll_time_; | 211 base::Time start_scroll_time_; |
212 | 212 |
213 // How many pixels to scroll per second. | 213 // How many pixels to scroll per second. |
214 int pixels_per_second_; | 214 int pixels_per_second_; |
215 | 215 |
216 // Y-coordinate of submenu_view_ when scrolling started. | 216 // Y-coordinate of submenu_view_ when scrolling started. |
217 int start_y_; | 217 int start_y_; |
218 | 218 |
219 DISALLOW_COPY_AND_ASSIGN(MenuScrollTask); | 219 DISALLOW_COPY_AND_ASSIGN(MenuScrollTask); |
220 }; | 220 }; |
221 | 221 |
(...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2048 (!pending_state_.item->HasSubmenu() || | 2048 (!pending_state_.item->HasSubmenu() || |
2049 !pending_state_.item->GetSubmenu()->IsShowing())) { | 2049 !pending_state_.item->GetSubmenu()->IsShowing())) { |
2050 // On exit if the user hasn't selected an item with a submenu, move the | 2050 // On exit if the user hasn't selected an item with a submenu, move the |
2051 // selection back to the parent menu item. | 2051 // selection back to the parent menu item. |
2052 SetSelection(pending_state_.item->GetParentMenuItem(), | 2052 SetSelection(pending_state_.item->GetParentMenuItem(), |
2053 SELECTION_OPEN_SUBMENU); | 2053 SELECTION_OPEN_SUBMENU); |
2054 } | 2054 } |
2055 } | 2055 } |
2056 | 2056 |
2057 } // namespace views | 2057 } // namespace views |
OLD | NEW |