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

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

Issue 6452011: Rework tree APIs to reflect Google style and more const-correctness.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 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/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 429
430 VARIANT var; 430 VARIANT var;
431 431
432 // Set the accessible role. 432 // Set the accessible role.
433 var.vt = VT_I4; 433 var.vt = VT_I4;
434 var.lVal = ROLE_SYSTEM_TEXT; 434 var.lVal = ROLE_SYSTEM_TEXT;
435 hr = pAccPropServices->SetHwndProp(m_hWnd, OBJID_CLIENT, 435 hr = pAccPropServices->SetHwndProp(m_hWnd, OBJID_CLIENT,
436 CHILDID_SELF, PROPID_ACC_ROLE, var); 436 CHILDID_SELF, PROPID_ACC_ROLE, var);
437 437
438 // Set the accessible name by getting the label text. 438 // Set the accessible name by getting the label text.
439 View* parent = textfield_->GetParent(); 439 View* parent = textfield_->parent();
440 int label_index = parent->GetChildIndex(textfield_) - 1; 440 int label_index = parent->GetIndexOf(textfield_) - 1;
441 if (label_index >= 0) { 441 if (label_index >= 0) {
442 // Try to find the name of this text field. 442 // Try to find the name of this text field.
443 // We expect it to be a Label preceeding this view (if it exists). 443 // We expect it to be a Label preceeding this view (if it exists).
444 string16 name; 444 string16 name;
445 View* label_view = parent->GetChildViewAt(label_index); 445 View* label_view = parent->GetChildViewAt(label_index);
446 if (label_view->GetClassName() == Label::kViewClassName && 446 if (label_view->GetClassName() == Label::kViewClassName &&
447 label_view->GetAccessibleName(&name)) { 447 label_view->GetAccessibleName(&name)) {
448 hr = pAccPropServices->SetHwndPropStr(m_hWnd, OBJID_CLIENT, 448 hr = pAccPropServices->SetHwndPropStr(m_hWnd, OBJID_CLIENT,
449 CHILDID_SELF, PROPID_ACC_NAME, name.c_str()); 449 CHILDID_SELF, PROPID_ACC_NAME, name.c_str());
450 } 450 }
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 1162 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
1163 Textfield* field) { 1163 Textfield* field) {
1164 if (NativeTextfieldViews::IsTextfieldViewsEnabled()) { 1164 if (NativeTextfieldViews::IsTextfieldViewsEnabled()) {
1165 return new NativeTextfieldViews(field); 1165 return new NativeTextfieldViews(field);
1166 } else { 1166 } else {
1167 return new NativeTextfieldWin(field); 1167 return new NativeTextfieldWin(field);
1168 } 1168 }
1169 } 1169 }
1170 1170
1171 } // namespace views 1171 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/tabbed_pane/native_tabbed_pane_win.cc ('k') | views/focus/external_focus_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698