OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |