Chromium Code Reviews| 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/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "ui/accessibility/ax_view_state.h" | 10 #include "ui/accessibility/ax_view_state.h" |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 277 initiating_drag_(false), | 277 initiating_drag_(false), |
| 278 aggregated_clicks_(0), | 278 aggregated_clicks_(0), |
| 279 drag_start_display_offset_(0), | 279 drag_start_display_offset_(0), |
| 280 touch_handles_hidden_due_to_scroll_(false), | 280 touch_handles_hidden_due_to_scroll_(false), |
| 281 weak_ptr_factory_(this) { | 281 weak_ptr_factory_(this) { |
| 282 set_context_menu_controller(this); | 282 set_context_menu_controller(this); |
| 283 set_drag_controller(this); | 283 set_drag_controller(this); |
| 284 SetBorder(scoped_ptr<Border>(new FocusableBorder())); | 284 SetBorder(scoped_ptr<Border>(new FocusableBorder())); |
| 285 SetFocusable(true); | 285 SetFocusable(true); |
| 286 | 286 |
| 287 if (ViewsDelegate::views_delegate) { | 287 if (ViewsDelegate::GetInstance()) { |
| 288 password_reveal_duration_ = ViewsDelegate::views_delegate-> | 288 password_reveal_duration_ = |
| 289 GetDefaultTextfieldObscuredRevealDuration(); | 289 ViewsDelegate::GetInstance() |
| 290 ->GetDefaultTextfieldObscuredRevealDuration(); | |
|
sadrul
2015/06/08 03:27:43
Does 'git cl format' do this?
mohsen
2015/06/08 19:27:34
Yes.
| |
| 290 } | 291 } |
| 291 } | 292 } |
| 292 | 293 |
| 293 Textfield::~Textfield() {} | 294 Textfield::~Textfield() {} |
| 294 | 295 |
| 295 void Textfield::SetReadOnly(bool read_only) { | 296 void Textfield::SetReadOnly(bool read_only) { |
| 296 // Update read-only without changing the focusable state (or active, etc.). | 297 // Update read-only without changing the focusable state (or active, etc.). |
| 297 read_only_ = read_only; | 298 read_only_ = read_only; |
| 298 if (GetInputMethod()) | 299 if (GetInputMethod()) |
| 299 GetInputMethod()->OnTextInputTypeChanged(this); | 300 GetInputMethod()->OnTextInputTypeChanged(this); |
| (...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1898 RequestFocus(); | 1899 RequestFocus(); |
| 1899 model_->MoveCursorTo(mouse); | 1900 model_->MoveCursorTo(mouse); |
| 1900 if (!selection_clipboard_text.empty()) { | 1901 if (!selection_clipboard_text.empty()) { |
| 1901 model_->InsertText(selection_clipboard_text); | 1902 model_->InsertText(selection_clipboard_text); |
| 1902 UpdateAfterChange(true, true); | 1903 UpdateAfterChange(true, true); |
| 1903 } | 1904 } |
| 1904 OnAfterUserAction(); | 1905 OnAfterUserAction(); |
| 1905 } | 1906 } |
| 1906 | 1907 |
| 1907 } // namespace views | 1908 } // namespace views |
| OLD | NEW |