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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 submenu_->ScrollRectToVisible(vis_rect); | 216 submenu_->ScrollRectToVisible(vis_rect); |
217 } | 217 } |
218 | 218 |
219 // SubmenuView being scrolled. | 219 // SubmenuView being scrolled. |
220 SubmenuView* submenu_; | 220 SubmenuView* submenu_; |
221 | 221 |
222 // Direction scrolling. | 222 // Direction scrolling. |
223 bool is_scrolling_up_; | 223 bool is_scrolling_up_; |
224 | 224 |
225 // Timer to periodically scroll. | 225 // Timer to periodically scroll. |
226 base::RepeatingTimer<MenuScrollTask> scrolling_timer_; | 226 base::RepeatingTimer scrolling_timer_; |
227 | 227 |
228 // Time we started scrolling at. | 228 // Time we started scrolling at. |
229 base::Time start_scroll_time_; | 229 base::Time start_scroll_time_; |
230 | 230 |
231 // How many pixels to scroll per second. | 231 // How many pixels to scroll per second. |
232 int pixels_per_second_; | 232 int pixels_per_second_; |
233 | 233 |
234 // Y-coordinate of submenu_view_ when scrolling started. | 234 // Y-coordinate of submenu_view_ when scrolling started. |
235 int start_y_; | 235 int start_y_; |
236 | 236 |
(...skipping 2133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2370 } | 2370 } |
2371 } | 2371 } |
2372 | 2372 |
2373 gfx::Screen* MenuController::GetScreen() { | 2373 gfx::Screen* MenuController::GetScreen() { |
2374 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL; | 2374 Widget* root = owner_ ? owner_->GetTopLevelWidget() : NULL; |
2375 return root ? gfx::Screen::GetScreenFor(root->GetNativeView()) | 2375 return root ? gfx::Screen::GetScreenFor(root->GetNativeView()) |
2376 : gfx::Screen::GetNativeScreen(); | 2376 : gfx::Screen::GetNativeScreen(); |
2377 } | 2377 } |
2378 | 2378 |
2379 } // namespace views | 2379 } // namespace views |
OLD | NEW |