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

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

Issue 1461923002: Change name of NativeTheme::instance() to make it clear it's web only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: NATIVE_THEME_EXPORT for mac Created 5 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
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/link.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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 render_text_->SetElideBehavior(gfx::NO_ELIDE); 397 render_text_->SetElideBehavior(gfx::NO_ELIDE);
398 render_text_->SetFontList(font_list); 398 render_text_->SetFontList(font_list);
399 render_text_->SetCursorEnabled(false); 399 render_text_->SetCursorEnabled(false);
400 render_text_->SetWordWrapBehavior(gfx::TRUNCATE_LONG_WORDS); 400 render_text_->SetWordWrapBehavior(gfx::TRUNCATE_LONG_WORDS);
401 401
402 elide_behavior_ = gfx::ELIDE_TAIL; 402 elide_behavior_ = gfx::ELIDE_TAIL;
403 enabled_color_set_ = disabled_color_set_ = background_color_set_ = false; 403 enabled_color_set_ = disabled_color_set_ = background_color_set_ = false;
404 subpixel_rendering_enabled_ = true; 404 subpixel_rendering_enabled_ = true;
405 auto_color_readability_ = true; 405 auto_color_readability_ = true;
406 multi_line_ = false; 406 multi_line_ = false;
407 UpdateColorsFromTheme(ui::NativeTheme::instance()); 407 UpdateColorsFromTheme(GetNativeTheme());
408 handles_tooltips_ = true; 408 handles_tooltips_ = true;
409 collapse_when_hidden_ = false; 409 collapse_when_hidden_ = false;
410 max_width_ = 0; 410 max_width_ = 0;
411 is_first_paint_text_ = true; 411 is_first_paint_text_ = true;
412 SetText(text); 412 SetText(text);
413 } 413 }
414 414
415 void Label::ResetLayout() { 415 void Label::ResetLayout() {
416 InvalidateLayout(); 416 InvalidateLayout();
417 PreferredSizeChanged(); 417 PreferredSizeChanged();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 574 }
575 575
576 bool Label::ShouldShowDefaultTooltip() const { 576 bool Label::ShouldShowDefaultTooltip() const {
577 const gfx::Size text_size = GetTextSize(); 577 const gfx::Size text_size = GetTextSize();
578 const gfx::Size size = GetContentsBounds().size(); 578 const gfx::Size size = GetContentsBounds().size();
579 return !obscured() && (text_size.width() > size.width() || 579 return !obscured() && (text_size.width() > size.width() ||
580 (multi_line() && text_size.height() > size.height())); 580 (multi_line() && text_size.height() > size.height()));
581 } 581 }
582 582
583 } // namespace views 583 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/link.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698