| 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/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 Loading... |
| 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; | |
| 74 case ui::ScopedAnimationDurationScaleMode::ZERO_DURATION: return 0; | 73 case ui::ScopedAnimationDurationScaleMode::ZERO_DURATION: return 0; |
| 75 } | 74 } |
| 76 return 100; | 75 return 100; |
| 77 } | 76 } |
| 78 | 77 |
| 79 // Get the default command for a given key |event| and selection state. | 78 // Get the default command for a given key |event| and selection state. |
| 80 int GetCommandForKeyEvent(const ui::KeyEvent& event, bool has_selection) { | 79 int GetCommandForKeyEvent(const ui::KeyEvent& event, bool has_selection) { |
| 81 if (event.type() != ui::ET_KEY_PRESSED || event.IsUnicodeKeyCode()) | 80 if (event.type() != ui::ET_KEY_PRESSED || event.IsUnicodeKeyCode()) |
| 82 return kNoCommand; | 81 return kNoCommand; |
| 83 | 82 |
| (...skipping 1706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 const size_t length = selection_clipboard_text.length(); | 1789 const size_t length = selection_clipboard_text.length(); |
| 1791 range = gfx::Range(range.start() + length, range.end() + length); | 1790 range = gfx::Range(range.start() + length, range.end() + length); |
| 1792 } | 1791 } |
| 1793 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); | 1792 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); |
| 1794 UpdateAfterChange(true, true); | 1793 UpdateAfterChange(true, true); |
| 1795 OnAfterUserAction(); | 1794 OnAfterUserAction(); |
| 1796 } | 1795 } |
| 1797 } | 1796 } |
| 1798 | 1797 |
| 1799 } // namespace views | 1798 } // namespace views |
| OLD | NEW |