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

Side by Side Diff: ui/views/controls/menu/menu_controller.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/textfield/textfield.h » ('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) 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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_controller.h ('k') | ui/views/controls/textfield/textfield.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698