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

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

Issue 6976048: views: Add OnEnabledChanged() method to View class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix DisableOnHover test? Created 9 years, 7 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) 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
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
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
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