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

Side by Side Diff: ui/views/controls/button/button_dropdown.cc

Issue 10026013: Update use of TimeDelta in chrome/browser/*, ui/views/*, and other places. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 7 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/aura/root_window.cc ('k') | ui/views/controls/textfield/native_textfield_views.cc » ('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) 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/button/button_dropdown.h" 5 #include "ui/views/controls/button/button_dropdown.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 // determine if the user dragged the mouse down (which should pop up the 54 // determine if the user dragged the mouse down (which should pop up the
55 // drag down menu immediately, instead of waiting for the timer) 55 // drag down menu immediately, instead of waiting for the timer)
56 y_position_on_lbuttondown_ = event.y(); 56 y_position_on_lbuttondown_ = event.y();
57 57
58 // Schedule a task that will show the menu. 58 // Schedule a task that will show the menu.
59 MessageLoop::current()->PostDelayedTask( 59 MessageLoop::current()->PostDelayedTask(
60 FROM_HERE, 60 FROM_HERE,
61 base::Bind(&ButtonDropDown::ShowDropDownMenu, 61 base::Bind(&ButtonDropDown::ShowDropDownMenu,
62 show_menu_factory_.GetWeakPtr(), 62 show_menu_factory_.GetWeakPtr(),
63 GetWidget()->GetNativeView()), 63 GetWidget()->GetNativeView()),
64 kMenuTimerDelay); 64 base::TimeDelta::FromMilliseconds(kMenuTimerDelay));
65 } 65 }
66 return ImageButton::OnMousePressed(event); 66 return ImageButton::OnMousePressed(event);
67 } 67 }
68 68
69 bool ButtonDropDown::OnMouseDragged(const MouseEvent& event) { 69 bool ButtonDropDown::OnMouseDragged(const MouseEvent& event) {
70 bool result = ImageButton::OnMouseDragged(event); 70 bool result = ImageButton::OnMouseDragged(event);
71 71
72 if (show_menu_factory_.HasWeakPtrs()) { 72 if (show_menu_factory_.HasWeakPtrs()) {
73 // If the mouse is dragged to a y position lower than where it was when 73 // If the mouse is dragged to a y position lower than where it was when
74 // clicked then we should not wait for the menu to appear but show 74 // clicked then we should not wait for the menu to appear but show
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 SetState(BS_NORMAL); 185 SetState(BS_NORMAL);
186 } 186 }
187 187
188 //////////////////////////////////////////////////////////////////////////////// 188 ////////////////////////////////////////////////////////////////////////////////
189 // 189 //
190 // ButtonDropDown - Accessibility 190 // ButtonDropDown - Accessibility
191 // 191 //
192 //////////////////////////////////////////////////////////////////////////////// 192 ////////////////////////////////////////////////////////////////////////////////
193 193
194 } // namespace views 194 } // namespace views
OLDNEW
« no previous file with comments | « ui/aura/root_window.cc ('k') | ui/views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698