| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 placeholder_text_color_(kDefaultPlaceholderTextColor), | 83 placeholder_text_color_(kDefaultPlaceholderTextColor), |
| 84 text_input_type_(ui::TEXT_INPUT_TYPE_TEXT), | 84 text_input_type_(ui::TEXT_INPUT_TYPE_TEXT), |
| 85 skip_input_method_cancel_composition_(false), | 85 skip_input_method_cancel_composition_(false), |
| 86 cursor_visible_(false), | 86 cursor_visible_(false), |
| 87 drop_cursor_visible_(false), | 87 drop_cursor_visible_(false), |
| 88 initiating_drag_(false), | 88 initiating_drag_(false), |
| 89 aggregated_clicks_(0), | 89 aggregated_clicks_(0), |
| 90 weak_ptr_factory_(this) { | 90 weak_ptr_factory_(this) { |
| 91 set_context_menu_controller(this); | 91 set_context_menu_controller(this); |
| 92 set_drag_controller(this); | 92 set_drag_controller(this); |
| 93 set_border(new FocusableBorder()); | 93 SetBorder(scoped_ptr<Border>(new FocusableBorder())); |
| 94 SetFocusable(true); | 94 SetFocusable(true); |
| 95 | 95 |
| 96 if (ViewsDelegate::views_delegate) { | 96 if (ViewsDelegate::views_delegate) { |
| 97 password_reveal_duration_ = ViewsDelegate::views_delegate-> | 97 password_reveal_duration_ = ViewsDelegate::views_delegate-> |
| 98 GetDefaultTextfieldObscuredRevealDuration(); | 98 GetDefaultTextfieldObscuredRevealDuration(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 if (NativeViewHost::kRenderNativeControlFocus) | 101 if (NativeViewHost::kRenderNativeControlFocus) |
| 102 focus_painter_ = Painter::CreateDashedFocusPainter(); | 102 focus_painter_ = Painter::CreateDashedFocusPainter(); |
| 103 } | 103 } |
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1491 const size_t length = selection_clipboard_text.length(); | 1491 const size_t length = selection_clipboard_text.length(); |
| 1492 range = gfx::Range(range.start() + length, range.end() + length); | 1492 range = gfx::Range(range.start() + length, range.end() + length); |
| 1493 } | 1493 } |
| 1494 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); | 1494 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); |
| 1495 UpdateAfterChange(true, true); | 1495 UpdateAfterChange(true, true); |
| 1496 OnAfterUserAction(); | 1496 OnAfterUserAction(); |
| 1497 } | 1497 } |
| 1498 } | 1498 } |
| 1499 | 1499 |
| 1500 } // namespace views | 1500 } // namespace views |
| OLD | NEW |