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

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
« no previous file with comments | « views/controls/textfield/textfield.h ('k') | views/view.h » ('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) 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 320
321 AccessibilityTypes::State Textfield::GetAccessibleState() { 321 AccessibilityTypes::State Textfield::GetAccessibleState() {
322 int state = 0; 322 int state = 0;
323 if (read_only()) 323 if (read_only())
324 state |= AccessibilityTypes::STATE_READONLY; 324 state |= AccessibilityTypes::STATE_READONLY;
325 if (IsPassword()) 325 if (IsPassword())
326 state |= AccessibilityTypes::STATE_PROTECTED; 326 state |= AccessibilityTypes::STATE_PROTECTED;
327 return state; 327 return state;
328 } 328 }
329 329
330 std::wstring Textfield::GetAccessibleValue() { 330 string16 Textfield::GetAccessibleValue() {
331 if (!text_.empty()) 331 if (!text_.empty())
332 return UTF16ToWide(text_); 332 return text_;
333 return std::wstring(); 333 return string16();
334 } 334 }
335 335
336 void Textfield::SetEnabled(bool enabled) { 336 void Textfield::SetEnabled(bool enabled) {
337 View::SetEnabled(enabled); 337 View::SetEnabled(enabled);
338 if (native_wrapper_) 338 if (native_wrapper_)
339 native_wrapper_->UpdateEnabled(); 339 native_wrapper_->UpdateEnabled();
340 } 340 }
341 341
342 void Textfield::Focus() { 342 void Textfield::Focus() {
343 // Forward the focus to the wrapper if it exists. 343 // Forward the focus to the wrapper if it exists.
(...skipping 29 matching lines...) Expand all
373 } 373 }
374 #endif 374 #endif
375 } 375 }
376 } 376 }
377 377
378 std::string Textfield::GetClassName() const { 378 std::string Textfield::GetClassName() const {
379 return kViewClassName; 379 return kViewClassName;
380 } 380 }
381 381
382 } // namespace views 382 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/textfield/textfield.h ('k') | views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698