views::Label displaying the tooltip should not elide.

The default eliding behavior on views::Label was changed to ELIDE_AT_END in
https://codereview.chromium.org/14654018 which make tooltips display incorrectly
in chromeos.

BUG=none
TEST=manual: trigger a long tooltip (one that cannot fit in one line). For
example, hover over the tab of any page with a long title (try the codereview
link above). Without this change, the tooltip label appears as a single line
elided at the end and has a weird size.

Review URL: https://chromiumcodereview.appspot.com/15772002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202039 0039d316-1c4b-4281-b951-d872f2087c98
parent 1ade3f86
......@@ -98,6 +98,7 @@ class TooltipController::Tooltip : public views::WidgetObserver {
kTooltipBorder));
}
label_.set_owned_by_client();
label_.SetMultiLine(true);
}
virtual ~Tooltip() {
......@@ -119,7 +120,7 @@ class TooltipController::Tooltip : public views::WidgetObserver {
label_.SetText(trimmed_text);
int width = max_width + 2 * kTooltipHorizontalPadding;
int height = label_.GetPreferredSize().height() +
int height = label_.GetHeightForWidth(max_width) +
2 * kTooltipVerticalPadding;
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoDropShadows)) {
width += 2 * kTooltipBorderWidth;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment