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

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 420013002: Introduce NON_ZERO_DURATION for animation unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: content_unittests Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/keyboard/keyboard_controller_unittest.cc ('k') | ui/views/widget/widget_unittest.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) 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/textfield/textfield.h" 5 #include "ui/views/controls/textfield/textfield.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "grit/ui_strings.h" 10 #include "grit/ui_strings.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 View::ConvertPointToScreen(src, &new_origin); 63 View::ConvertPointToScreen(src, &new_origin);
64 r->set_origin(new_origin); 64 r->set_origin(new_origin);
65 } 65 }
66 66
67 // Get the drag selection timer delay, respecting animation scaling for testing. 67 // Get the drag selection timer delay, respecting animation scaling for testing.
68 int GetDragSelectionDelay() { 68 int GetDragSelectionDelay() {
69 switch (ui::ScopedAnimationDurationScaleMode::duration_scale_mode()) { 69 switch (ui::ScopedAnimationDurationScaleMode::duration_scale_mode()) {
70 case ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION: return 100; 70 case ui::ScopedAnimationDurationScaleMode::NORMAL_DURATION: return 100;
71 case ui::ScopedAnimationDurationScaleMode::FAST_DURATION: return 25; 71 case ui::ScopedAnimationDurationScaleMode::FAST_DURATION: return 25;
72 case ui::ScopedAnimationDurationScaleMode::SLOW_DURATION: return 400; 72 case ui::ScopedAnimationDurationScaleMode::SLOW_DURATION: return 400;
73 case ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION: return 1;
73 case ui::ScopedAnimationDurationScaleMode::ZERO_DURATION: return 0; 74 case ui::ScopedAnimationDurationScaleMode::ZERO_DURATION: return 0;
74 } 75 }
75 return 100; 76 return 100;
76 } 77 }
77 78
78 // Get the default command for a given key |event| and selection state. 79 // Get the default command for a given key |event| and selection state.
79 int GetCommandForKeyEvent(const ui::KeyEvent& event, bool has_selection) { 80 int GetCommandForKeyEvent(const ui::KeyEvent& event, bool has_selection) {
80 if (event.type() != ui::ET_KEY_PRESSED || event.IsUnicodeKeyCode()) 81 if (event.type() != ui::ET_KEY_PRESSED || event.IsUnicodeKeyCode())
81 return kNoCommand; 82 return kNoCommand;
82 83
(...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 const size_t length = selection_clipboard_text.length(); 1790 const size_t length = selection_clipboard_text.length();
1790 range = gfx::Range(range.start() + length, range.end() + length); 1791 range = gfx::Range(range.start() + length, range.end() + length);
1791 } 1792 }
1792 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); 1793 model_->MoveCursorTo(gfx::SelectionModel(range, affinity));
1793 UpdateAfterChange(true, true); 1794 UpdateAfterChange(true, true);
1794 OnAfterUserAction(); 1795 OnAfterUserAction();
1795 } 1796 }
1796 } 1797 }
1797 1798
1798 } // namespace views 1799 } // namespace views
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_controller_unittest.cc ('k') | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698