OLD | NEW |
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 <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 #include <cmath> | 10 #include <cmath> |
9 #include <limits> | 11 #include <limits> |
10 #include <utility> | 12 #include <utility> |
11 #include <vector> | 13 #include <vector> |
12 | 14 |
13 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
14 #include "base/logging.h" | 16 #include "base/logging.h" |
15 #include "base/profiler/scoped_tracker.h" | 17 #include "base/profiler/scoped_tracker.h" |
16 #include "base/strings/string_split.h" | 18 #include "base/strings/string_split.h" |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 } | 577 } |
576 | 578 |
577 bool Label::ShouldShowDefaultTooltip() const { | 579 bool Label::ShouldShowDefaultTooltip() const { |
578 const gfx::Size text_size = GetTextSize(); | 580 const gfx::Size text_size = GetTextSize(); |
579 const gfx::Size size = GetContentsBounds().size(); | 581 const gfx::Size size = GetContentsBounds().size(); |
580 return !obscured() && (text_size.width() > size.width() || | 582 return !obscured() && (text_size.width() > size.width() || |
581 (multi_line() && text_size.height() > size.height())); | 583 (multi_line() && text_size.height() > size.height())); |
582 } | 584 } |
583 | 585 |
584 } // namespace views | 586 } // namespace views |
OLD | NEW |