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

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

Issue 7349021: Convert some more view methods to the ui/views style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane/native_tabbed_pane_win.cc ('k') | views/examples/scroll_view_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698