| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 if (read_only()) | 906 if (read_only()) |
| 907 state->AddStateFlag(ui::AX_STATE_READ_ONLY); | 907 state->AddStateFlag(ui::AX_STATE_READ_ONLY); |
| 908 else | 908 else |
| 909 state->AddStateFlag(ui::AX_STATE_EDITABLE); | 909 state->AddStateFlag(ui::AX_STATE_EDITABLE); |
| 910 if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) { | 910 if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) { |
| 911 state->AddStateFlag(ui::AX_STATE_PROTECTED); | 911 state->AddStateFlag(ui::AX_STATE_PROTECTED); |
| 912 state->value = base::string16(text().size(), '*'); | 912 state->value = base::string16(text().size(), '*'); |
| 913 } else { | 913 } else { |
| 914 state->value = text(); | 914 state->value = text(); |
| 915 } | 915 } |
| 916 state->placeholder = GetPlaceholderText(); |
| 917 |
| 916 const gfx::Range range = GetSelectedRange(); | 918 const gfx::Range range = GetSelectedRange(); |
| 917 state->selection_start = range.start(); | 919 state->selection_start = range.start(); |
| 918 state->selection_end = range.end(); | 920 state->selection_end = range.end(); |
| 919 | 921 |
| 920 if (!read_only()) { | 922 if (!read_only()) { |
| 921 state->set_value_callback = | 923 state->set_value_callback = |
| 922 base::Bind(&Textfield::AccessibilitySetValue, | 924 base::Bind(&Textfield::AccessibilitySetValue, |
| 923 weak_ptr_factory_.GetWeakPtr()); | 925 weak_ptr_factory_.GetWeakPtr()); |
| 924 } | 926 } |
| 925 } | 927 } |
| (...skipping 1034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1960 RequestFocus(); | 1962 RequestFocus(); |
| 1961 model_->MoveCursorTo(mouse); | 1963 model_->MoveCursorTo(mouse); |
| 1962 if (!selection_clipboard_text.empty()) { | 1964 if (!selection_clipboard_text.empty()) { |
| 1963 model_->InsertText(selection_clipboard_text); | 1965 model_->InsertText(selection_clipboard_text); |
| 1964 UpdateAfterChange(true, true); | 1966 UpdateAfterChange(true, true); |
| 1965 } | 1967 } |
| 1966 OnAfterUserAction(); | 1968 OnAfterUserAction(); |
| 1967 } | 1969 } |
| 1968 | 1970 |
| 1969 } // namespace views | 1971 } // namespace views |
| OLD | NEW |