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

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

Issue 10916222: Conservative update button/label/textfield content (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Nit fixes.wq Created 8 years, 3 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
« no previous file with comments | « ui/views/controls/label.cc ('k') | no next file » | 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) 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 } 142 }
143 143
144 void Textfield::SetTextInputType(ui::TextInputType type) { 144 void Textfield::SetTextInputType(ui::TextInputType type) {
145 text_input_type_ = type; 145 text_input_type_ = type;
146 bool should_be_obscured = type == ui::TEXT_INPUT_TYPE_PASSWORD; 146 bool should_be_obscured = type == ui::TEXT_INPUT_TYPE_PASSWORD;
147 if (IsObscured() != should_be_obscured) 147 if (IsObscured() != should_be_obscured)
148 SetObscured(should_be_obscured); 148 SetObscured(should_be_obscured);
149 } 149 }
150 150
151 void Textfield::SetText(const string16& text) { 151 void Textfield::SetText(const string16& text) {
152 if (text == text_)
153 return;
152 text_ = text; 154 text_ = text;
153 if (native_wrapper_) 155 if (native_wrapper_)
154 native_wrapper_->UpdateText(); 156 native_wrapper_->UpdateText();
155 } 157 }
156 158
157 void Textfield::AppendText(const string16& text) { 159 void Textfield::AppendText(const string16& text) {
158 text_ += text; 160 text_ += text;
159 if (native_wrapper_) 161 if (native_wrapper_)
160 native_wrapper_->AppendText(text); 162 native_wrapper_->AppendText(text);
161 } 163 }
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper( 488 NativeTextfieldWrapper* NativeTextfieldWrapper::CreateWrapper(
487 Textfield* field) { 489 Textfield* field) {
488 #if defined(OS_WIN) && !defined(USE_AURA) 490 #if defined(OS_WIN) && !defined(USE_AURA)
489 if (!UseNativeTextfieldViews()) 491 if (!UseNativeTextfieldViews())
490 return new NativeTextfieldWin(field); 492 return new NativeTextfieldWin(field);
491 #endif 493 #endif
492 return new NativeTextfieldViews(field); 494 return new NativeTextfieldViews(field);
493 } 495 }
494 496
495 } // namespace views 497 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/label.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698