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

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

Issue 113203004: Fix some string16 -> base::string16 that have crept into ui/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 | « no previous file | ui/views/controls/link.h » ('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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 gfx::Insets insets = GetInsets(); 226 gfx::Insets insets = GetInsets();
227 size.Enlarge(insets.width(), insets.height()); 227 size.Enlarge(insets.width(), insets.height());
228 return size; 228 return size;
229 } 229 }
230 230
231 gfx::Size Label::GetMinimumSize() { 231 gfx::Size Label::GetMinimumSize() {
232 gfx::Size text_size(GetTextSize()); 232 gfx::Size text_size(GetTextSize());
233 if ((!visible() && collapse_when_hidden_) || text_size.IsEmpty()) 233 if ((!visible() && collapse_when_hidden_) || text_size.IsEmpty())
234 return gfx::Size(); 234 return gfx::Size();
235 235
236 gfx::Size size(font_list_.GetStringWidth(string16(gfx::kEllipsisUTF16)), 236 gfx::Size size(font_list_.GetStringWidth(base::string16(gfx::kEllipsisUTF16)),
237 font_list_.GetHeight()); 237 font_list_.GetHeight());
238 size.SetToMin(text_size); // The actual text may be shorter than an ellipsis. 238 size.SetToMin(text_size); // The actual text may be shorter than an ellipsis.
239 gfx::Insets insets = GetInsets(); 239 gfx::Insets insets = GetInsets();
240 size.Enlarge(insets.width(), insets.height()); 240 size.Enlarge(insets.width(), insets.height());
241 return size; 241 return size;
242 } 242 }
243 243
244 int Label::GetHeightForWidth(int w) { 244 int Label::GetHeightForWidth(int w) {
245 if (!is_multi_line_) 245 if (!is_multi_line_)
246 return View::GetHeightForWidth(w); 246 return View::GetHeightForWidth(w);
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 for (int i = 0; i < kCachedSizeLimit; ++i) 537 for (int i = 0; i < kCachedSizeLimit; ++i)
538 cached_heights_[i] = gfx::Size(); 538 cached_heights_[i] = gfx::Size();
539 } 539 }
540 540
541 bool Label::ShouldShowDefaultTooltip() const { 541 bool Label::ShouldShowDefaultTooltip() const {
542 return !is_multi_line_ && 542 return !is_multi_line_ &&
543 gfx::GetStringWidth(text_, font_list_) > GetAvailableRect().width(); 543 gfx::GetStringWidth(text_, font_list_) > GetAvailableRect().width();
544 } 544 }
545 545
546 } // namespace views 546 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/link.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698