| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/textfield/textfield.h" | 5 #include "ui/views/controls/textfield/textfield.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 | 438 |
| 439 // The native wrapper's lifetime will be managed by the view hierarchy after | 439 // The native wrapper's lifetime will be managed by the view hierarchy after |
| 440 // we call AddChildView. | 440 // we call AddChildView. |
| 441 native_wrapper_ = NativeTextfieldWrapper::CreateWrapper(this); | 441 native_wrapper_ = NativeTextfieldWrapper::CreateWrapper(this); |
| 442 AddChildView(native_wrapper_->GetView()); | 442 AddChildView(native_wrapper_->GetView()); |
| 443 // TODO(beng): Move this initialization to NativeTextfieldWin once it | 443 // TODO(beng): Move this initialization to NativeTextfieldWin once it |
| 444 // subclasses NativeControlWin. | 444 // subclasses NativeControlWin. |
| 445 UpdateAllProperties(); | 445 UpdateAllProperties(); |
| 446 | 446 |
| 447 #if defined(OS_WIN) && !defined(USE_AURA) | 447 #if defined(OS_WIN) && !defined(USE_AURA) |
| 448 if (!views::Widget::IsPureViews()) { | 448 // TODO(beng): remove this once NativeTextfieldWin subclasses |
| 449 // TODO(beng): remove this once NativeTextfieldWin subclasses | 449 // NativeControlWin. This is currently called to perform post-AddChildView |
| 450 // NativeControlWin. This is currently called to perform post-AddChildView | 450 // initialization for the wrapper. |
| 451 // initialization for the wrapper. | 451 // |
| 452 // | 452 // Remove the include for native_textfield_win.h above when you fix this. |
| 453 // Remove the include for native_textfield_win.h above when you fix this. | 453 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); |
| 454 static_cast<NativeTextfieldWin*>(native_wrapper_)->AttachHack(); | |
| 455 } | |
| 456 #endif | 454 #endif |
| 457 } | 455 } |
| 458 } | 456 } |
| 459 | 457 |
| 460 std::string Textfield::GetClassName() const { | 458 std::string Textfield::GetClassName() const { |
| 461 return kViewClassName; | 459 return kViewClassName; |
| 462 } | 460 } |
| 463 | 461 |
| 464 } // namespace views | 462 } // namespace views |
| OLD | NEW |