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

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

Issue 15684004: Refine Views textfield state interaction, testing, and examples. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add and expand on comments. Created 7 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
OLDNEW
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/command_line.h" 9 #include "base/command_line.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 void Textfield::SetController(TextfieldController* controller) { 122 void Textfield::SetController(TextfieldController* controller) {
123 controller_ = controller; 123 controller_ = controller;
124 } 124 }
125 125
126 TextfieldController* Textfield::GetController() const { 126 TextfieldController* Textfield::GetController() const {
127 return controller_; 127 return controller_;
128 } 128 }
129 129
130 void Textfield::SetReadOnly(bool read_only) { 130 void Textfield::SetReadOnly(bool read_only) {
131 // Update read-only without changing the focusable state (or active, etc.).
131 read_only_ = read_only; 132 read_only_ = read_only;
132 set_focusable(!read_only);
133 if (native_wrapper_) { 133 if (native_wrapper_) {
134 native_wrapper_->UpdateReadOnly(); 134 native_wrapper_->UpdateReadOnly();
135 native_wrapper_->UpdateTextColor(); 135 native_wrapper_->UpdateTextColor();
136 native_wrapper_->UpdateBackgroundColor(); 136 native_wrapper_->UpdateBackgroundColor();
137 } 137 }
138 } 138 }
139 139
140 bool Textfield::IsObscured() const { 140 bool Textfield::IsObscured() const {
141 return style_ & STYLE_OBSCURED; 141 return style_ & STYLE_OBSCURED;
142 } 142 }
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 601 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
602 Textfield* field) { 602 Textfield* field) {
603 #if defined(OS_WIN) && !defined(USE_AURA) 603 #if defined(OS_WIN) && !defined(USE_AURA)
604 if (!Textfield::IsViewsTextfieldEnabled()) 604 if (!Textfield::IsViewsTextfieldEnabled())
605 return new NativeTextfieldWin(field); 605 return new NativeTextfieldWin(field);
606 #endif 606 #endif
607 return new NativeTextfieldViews(field); 607 return new NativeTextfieldViews(field);
608 } 608 }
609 609
610 } // namespace views 610 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views_unittest.cc ('k') | ui/views/examples/textfield_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698