Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Side by Side Diff: ui/views/controls/textfield/textfield.cc

Issue 196133012: Fix incorrect use of AXState caused when refactoring two enums into one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename SetStateFlag -> AddStateFlag Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/progress_bar_unittest.cc ('k') | ui/views/controls/tree/tree_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/controls/progress_bar_unittest.cc ('k') | ui/views/controls/tree/tree_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698