OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/controls/textfield/native_textfield_win.h" | 5 #include "views/controls/textfield/native_textfield_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 hr = pAccPropServices->SetHwndProp(m_hWnd, OBJID_CLIENT, | 455 hr = pAccPropServices->SetHwndProp(m_hWnd, OBJID_CLIENT, |
456 CHILDID_SELF, PROPID_ACC_ROLE, var); | 456 CHILDID_SELF, PROPID_ACC_ROLE, var); |
457 | 457 |
458 // Set the accessible name by getting the label text. | 458 // Set the accessible name by getting the label text. |
459 View* parent = textfield_->parent(); | 459 View* parent = textfield_->parent(); |
460 int label_index = parent->GetIndexOf(textfield_) - 1; | 460 int label_index = parent->GetIndexOf(textfield_) - 1; |
461 if (label_index >= 0) { | 461 if (label_index >= 0) { |
462 // Try to find the name of this text field. | 462 // Try to find the name of this text field. |
463 // We expect it to be a Label preceeding this view (if it exists). | 463 // We expect it to be a Label preceeding this view (if it exists). |
464 string16 name; | 464 string16 name; |
465 View* label_view = parent->GetChildViewAt(label_index); | 465 View* label_view = parent->child_at(label_index); |
466 if (label_view->GetClassName() == Label::kViewClassName) { | 466 if (label_view->GetClassName() == Label::kViewClassName) { |
467 ui::AccessibleViewState state; | 467 ui::AccessibleViewState state; |
468 label_view->GetAccessibleState(&state); | 468 label_view->GetAccessibleState(&state); |
469 hr = pAccPropServices->SetHwndPropStr(m_hWnd, OBJID_CLIENT, | 469 hr = pAccPropServices->SetHwndPropStr(m_hWnd, OBJID_CLIENT, |
470 CHILDID_SELF, PROPID_ACC_NAME, state.name.c_str()); | 470 CHILDID_SELF, PROPID_ACC_NAME, state.name.c_str()); |
471 } | 471 } |
472 } | 472 } |
473 } | 473 } |
474 | 474 |
475 void NativeTextfieldWin::UpdateAccessibleState(uint32 state_flag, | 475 void NativeTextfieldWin::UpdateAccessibleState(uint32 state_flag, |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 | 1155 |
1156 // static | 1156 // static |
1157 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( | 1157 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( |
1158 Textfield* field) { | 1158 Textfield* field) { |
1159 if (views::Widget::IsPureViews()) | 1159 if (views::Widget::IsPureViews()) |
1160 return new NativeTextfieldViews(field); | 1160 return new NativeTextfieldViews(field); |
1161 return new NativeTextfieldWin(field); | 1161 return new NativeTextfieldWin(field); |
1162 } | 1162 } |
1163 | 1163 |
1164 } // namespace views | 1164 } // namespace views |
OLD | NEW |