| OLD | NEW |
| 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/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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 ui::Range range; | 370 ui::Range range; |
| 371 native_wrapper_->GetSelectedRange(&range); | 371 native_wrapper_->GetSelectedRange(&range); |
| 372 state->selection_start = range.start(); | 372 state->selection_start = range.start(); |
| 373 state->selection_end = range.end(); | 373 state->selection_end = range.end(); |
| 374 } | 374 } |
| 375 | 375 |
| 376 TextInputClient* Textfield::GetTextInputClient() { | 376 TextInputClient* Textfield::GetTextInputClient() { |
| 377 return native_wrapper_ ? native_wrapper_->GetTextInputClient() : NULL; | 377 return native_wrapper_ ? native_wrapper_->GetTextInputClient() : NULL; |
| 378 } | 378 } |
| 379 | 379 |
| 380 void Textfield::SetEnabled(bool enabled) { | 380 void Textfield::OnEnabledChanged() { |
| 381 View::SetEnabled(enabled); | 381 View::OnEnabledChanged(); |
| 382 if (native_wrapper_) | 382 if (native_wrapper_) |
| 383 native_wrapper_->UpdateEnabled(); | 383 native_wrapper_->UpdateEnabled(); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void Textfield::ViewHierarchyChanged(bool is_add, View* parent, View* child) { | 386 void Textfield::ViewHierarchyChanged(bool is_add, View* parent, View* child) { |
| 387 if (is_add && !native_wrapper_ && GetWidget() && !initialized_) { | 387 if (is_add && !native_wrapper_ && GetWidget() && !initialized_) { |
| 388 initialized_ = true; | 388 initialized_ = true; |
| 389 | 389 |
| 390 // The native wrapper's lifetime will be managed by the view hierarchy after | 390 // The native wrapper's lifetime will be managed by the view hierarchy after |
| 391 // we call AddChildView. | 391 // we call AddChildView. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 407 } | 407 } |
| 408 #endif | 408 #endif |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 std::string Textfield::GetClassName() const { | 412 std::string Textfield::GetClassName() const { |
| 413 return kViewClassName; | 413 return kViewClassName; |
| 414 } | 414 } |
| 415 | 415 |
| 416 } // namespace views | 416 } // namespace views |
| OLD | NEW |