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

Side by Side Diff: ui/views/controls/label.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/button/text_button.cc ('k') | ui/views/controls/textfield/textfield.cc » ('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) 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/label.h" 5 #include "ui/views/controls/label.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <vector> 10 #include <vector>
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 } 47 }
48 48
49 void Label::SetFont(const gfx::Font& font) { 49 void Label::SetFont(const gfx::Font& font) {
50 font_ = font; 50 font_ = font;
51 text_size_valid_ = false; 51 text_size_valid_ = false;
52 PreferredSizeChanged(); 52 PreferredSizeChanged();
53 SchedulePaint(); 53 SchedulePaint();
54 } 54 }
55 55
56 void Label::SetText(const string16& text) { 56 void Label::SetText(const string16& text) {
57 if (text == text_)
58 return;
57 text_ = text; 59 text_ = text;
58 text_size_valid_ = false; 60 text_size_valid_ = false;
59 is_email_ = false; 61 is_email_ = false;
60 PreferredSizeChanged(); 62 PreferredSizeChanged();
61 SchedulePaint(); 63 SchedulePaint();
62 } 64 }
63 65
64 void Label::SetEmail(const string16& email) { 66 void Label::SetEmail(const string16& email) {
65 SetText(email); 67 SetText(email);
66 is_email_ = true; 68 is_email_ = true;
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 ui::ELIDE_AT_END); 495 ui::ELIDE_AT_END);
494 } else { 496 } else {
495 *paint_text = text_; 497 *paint_text = text_;
496 } 498 }
497 499
498 *text_bounds = GetTextBounds(); 500 *text_bounds = GetTextBounds();
499 *flags = ComputeDrawStringFlags(); 501 *flags = ComputeDrawStringFlags();
500 } 502 }
501 503
502 } // namespace views 504 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/text_button.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698