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 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 729 |
730 void Textfield::OnDragDone() { | 730 void Textfield::OnDragDone() { |
731 initiating_drag_ = false; | 731 initiating_drag_ = false; |
732 drop_cursor_visible_ = false; | 732 drop_cursor_visible_ = false; |
733 } | 733 } |
734 | 734 |
735 void Textfield::GetAccessibleState(ui::AXViewState* state) { | 735 void Textfield::GetAccessibleState(ui::AXViewState* state) { |
736 state->role = ui::AX_ROLE_TEXT_FIELD; | 736 state->role = ui::AX_ROLE_TEXT_FIELD; |
737 state->name = accessible_name_; | 737 state->name = accessible_name_; |
738 if (read_only()) | 738 if (read_only()) |
739 state->state |= ui::AX_STATE_READ_ONLY; | 739 state->AddStateFlag(ui::AX_STATE_READ_ONLY); |
740 if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) | 740 if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) |
741 state->state |= ui::AX_STATE_PROTECTED; | 741 state->AddStateFlag(ui::AX_STATE_PROTECTED); |
742 state->value = text(); | 742 state->value = text(); |
743 | 743 |
744 const gfx::Range range = GetSelectedRange(); | 744 const gfx::Range range = GetSelectedRange(); |
745 state->selection_start = range.start(); | 745 state->selection_start = range.start(); |
746 state->selection_end = range.end(); | 746 state->selection_end = range.end(); |
747 | 747 |
748 if (!read_only()) { | 748 if (!read_only()) { |
749 state->set_value_callback = | 749 state->set_value_callback = |
750 base::Bind(&Textfield::AccessibilitySetValue, | 750 base::Bind(&Textfield::AccessibilitySetValue, |
751 weak_ptr_factory_.GetWeakPtr()); | 751 weak_ptr_factory_.GetWeakPtr()); |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1496 const size_t length = selection_clipboard_text.length(); | 1496 const size_t length = selection_clipboard_text.length(); |
1497 range = gfx::Range(range.start() + length, range.end() + length); | 1497 range = gfx::Range(range.start() + length, range.end() + length); |
1498 } | 1498 } |
1499 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); | 1499 model_->MoveCursorTo(gfx::SelectionModel(range, affinity)); |
1500 UpdateAfterChange(true, true); | 1500 UpdateAfterChange(true, true); |
1501 OnAfterUserAction(); | 1501 OnAfterUserAction(); |
1502 } | 1502 } |
1503 } | 1503 } |
1504 | 1504 |
1505 } // namespace views | 1505 } // namespace views |
OLD | NEW |