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

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: Expand cut/copy/paste test. 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 read_only_ = read_only; 131 read_only_ = read_only;
132 set_focusable(!read_only);
oshima 2013/05/23 17:52:58 can you add comment not to change focusable so tha
msw 2013/05/23 19:08:13 Done.
133 if (native_wrapper_) { 132 if (native_wrapper_) {
134 native_wrapper_->UpdateReadOnly(); 133 native_wrapper_->UpdateReadOnly();
135 native_wrapper_->UpdateTextColor(); 134 native_wrapper_->UpdateTextColor();
136 native_wrapper_->UpdateBackgroundColor(); 135 native_wrapper_->UpdateBackgroundColor();
137 } 136 }
138 } 137 }
139 138
140 bool Textfield::IsObscured() const { 139 bool Textfield::IsObscured() const {
141 return style_ & STYLE_OBSCURED; 140 return style_ & STYLE_OBSCURED;
142 } 141 }
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 600 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
602 Textfield* field) { 601 Textfield* field) {
603 #if defined(OS_WIN) && !defined(USE_AURA) 602 #if defined(OS_WIN) && !defined(USE_AURA)
604 if (!Textfield::IsViewsTextfieldEnabled()) 603 if (!Textfield::IsViewsTextfieldEnabled())
605 return new NativeTextfieldWin(field); 604 return new NativeTextfieldWin(field);
606 #endif 605 #endif
607 return new NativeTextfieldViews(field); 606 return new NativeTextfieldViews(field);
608 } 607 }
609 608
610 } // namespace views 609 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698