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

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

Issue 15419002: views: Store only the name of the class in kViewClassName constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/menu/menu_item_view.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 18 matching lines...) Expand all
29 29
30 // The padding for the focus border when rendering focused text. 30 // The padding for the focus border when rendering focused text.
31 const int kFocusBorderPadding = 1; 31 const int kFocusBorderPadding = 1;
32 const int kCachedSizeLimit = 10; 32 const int kCachedSizeLimit = 10;
33 33
34 } // namespace 34 } // namespace
35 35
36 namespace views { 36 namespace views {
37 37
38 // static 38 // static
39 const char Label::kViewClassName[] = "views/Label"; 39 const char Label::kViewClassName[] = "Label";
40 40
41 Label::Label() { 41 Label::Label() {
42 Init(string16(), GetDefaultFont()); 42 Init(string16(), GetDefaultFont());
43 } 43 }
44 44
45 Label::Label(const string16& text) { 45 Label::Label(const string16& text) {
46 Init(text, GetDefaultFont()); 46 Init(text, GetDefaultFont());
47 } 47 }
48 48
49 Label::Label(const string16& text, const gfx::Font& font) { 49 Label::Label(const string16& text, const gfx::Font& font) {
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 for (int i = 0; i < kCachedSizeLimit; ++i) 521 for (int i = 0; i < kCachedSizeLimit; ++i)
522 cached_heights_[i] = gfx::Size(); 522 cached_heights_[i] = gfx::Size();
523 } 523 }
524 524
525 bool Label::ShouldShowDefaultTooltip() const { 525 bool Label::ShouldShowDefaultTooltip() const {
526 return !is_multi_line_ && 526 return !is_multi_line_ &&
527 font_.GetStringWidth(text_) > GetAvailableRect().width(); 527 font_.GetStringWidth(text_) > GetAvailableRect().width();
528 } 528 }
529 529
530 } // namespace views 530 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698