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

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

Issue 6192007: Remove wstring from views. Part 3: Switch accessibility strings to string16.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/textfield.h" 5 #include "views/controls/textfield/textfield.h"
6 6
7 #if defined(OS_LINUX) 7 #if defined(OS_LINUX)
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 #endif 9 #endif
10 10
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 319
320 AccessibilityTypes::State Textfield::GetAccessibleState() { 320 AccessibilityTypes::State Textfield::GetAccessibleState() {
321 int state = 0; 321 int state = 0;
322 if (read_only()) 322 if (read_only())
323 state |= AccessibilityTypes::STATE_READONLY; 323 state |= AccessibilityTypes::STATE_READONLY;
324 if (IsPassword()) 324 if (IsPassword())
325 state |= AccessibilityTypes::STATE_PROTECTED; 325 state |= AccessibilityTypes::STATE_PROTECTED;
326 return state; 326 return state;
327 } 327 }
328 328
329 std::wstring Textfield::GetAccessibleValue() { 329 string16 Textfield::GetAccessibleValue() {
330 if (!text_.empty()) 330 if (!text_.empty())
331 return UTF16ToWide(text_); 331 return text_;
332 return std::wstring(); 332 return string16();
333 } 333 }
334 334
335 void Textfield::SetEnabled(bool enabled) { 335 void Textfield::SetEnabled(bool enabled) {
336 View::SetEnabled(enabled); 336 View::SetEnabled(enabled);
337 if (native_wrapper_) 337 if (native_wrapper_)
338 native_wrapper_->UpdateEnabled(); 338 native_wrapper_->UpdateEnabled();
339 } 339 }
340 340
341 void Textfield::Focus() { 341 void Textfield::Focus() {
342 // Forward the focus to the wrapper if it exists. 342 // Forward the focus to the wrapper if it exists.
(...skipping 27 matching lines...) Expand all
370 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); 370 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack();
371 #endif 371 #endif
372 } 372 }
373 } 373 }
374 374
375 std::string Textfield::GetClassName() const { 375 std::string Textfield::GetClassName() const {
376 return kViewClassName; 376 return kViewClassName;
377 } 377 }
378 378
379 } // namespace views 379 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698