| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "ui/accessibility/ax_view_state.h" | 17 #include "ui/accessibility/ax_view_state.h" |
| 18 #include "ui/base/resource/resource_bundle.h" | 18 #include "ui/base/resource/resource_bundle.h" |
| 19 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
| 20 #include "ui/gfx/color_utils.h" | 20 #include "ui/gfx/color_utils.h" |
| 21 #include "ui/gfx/insets.h" | 21 #include "ui/gfx/geometry/insets.h" |
| 22 #include "ui/gfx/text_elider.h" | 22 #include "ui/gfx/text_elider.h" |
| 23 #include "ui/gfx/text_utils.h" | 23 #include "ui/gfx/text_utils.h" |
| 24 #include "ui/gfx/utf16_indexing.h" | 24 #include "ui/gfx/utf16_indexing.h" |
| 25 #include "ui/native_theme/native_theme.h" | 25 #include "ui/native_theme/native_theme.h" |
| 26 #include "ui/views/background.h" | 26 #include "ui/views/background.h" |
| 27 | 27 |
| 28 namespace { | 28 namespace { |
| 29 | 29 |
| 30 const int kCachedSizeLimit = 10; | 30 const int kCachedSizeLimit = 10; |
| 31 const base::char16 kPasswordReplacementChar = '*'; | 31 const base::char16 kPasswordReplacementChar = '*'; |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 cached_heights_[i] = gfx::Size(); | 535 cached_heights_[i] = gfx::Size(); |
| 536 } | 536 } |
| 537 | 537 |
| 538 bool Label::ShouldShowDefaultTooltip() const { | 538 bool Label::ShouldShowDefaultTooltip() const { |
| 539 return !is_multi_line_ && !is_obscured_ && | 539 return !is_multi_line_ && !is_obscured_ && |
| 540 gfx::GetStringWidth(layout_text(), font_list_) > | 540 gfx::GetStringWidth(layout_text(), font_list_) > |
| 541 GetAvailableRect().width(); | 541 GetAvailableRect().width(); |
| 542 } | 542 } |
| 543 | 543 |
| 544 } // namespace views | 544 } // namespace views |
| OLD | NEW |