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

Unified Diff: ui/views/controls/button/text_button.cc

Issue 10916222: Conservative update button/label/textfield content (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | ui/views/controls/label.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/text_button.cc
diff --git a/ui/views/controls/button/text_button.cc b/ui/views/controls/button/text_button.cc
index 1a4c4e700cadce959305fb9e01ea9af2caf37e65..5e2634fd4628fbfdb65e3fc306dff41c2730fe8f 100644
--- a/ui/views/controls/button/text_button.cc
+++ b/ui/views/controls/button/text_button.cc
@@ -291,9 +291,11 @@ void TextButtonBase::SetIsDefault(bool is_default) {
}
void TextButtonBase::SetText(const string16& text) {
- text_ = text;
- SetAccessibleName(text);
- UpdateTextSize();
+ if (text != text_) {
Daniel Erat 2012/09/11 20:53:37 nit: just: if (text == text_) return; and
+ text_ = text;
+ SetAccessibleName(text);
+ UpdateTextSize();
+ }
}
void TextButtonBase::SetFont(const gfx::Font& font) {
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | ui/views/controls/label.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698