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

Side by Side Diff: chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc

Issue 10834207: aura: Long launcher tooltips should elide at end. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 4 months 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 | « chrome/browser/ui/views/content_setting_bubble_contents.cc ('k') | ui/views/controls/label.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 "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h" 5 #include "chrome/browser/ui/views/location_bar/icon_label_bubble_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
9 #include "grit/theme_resources.h" 9 #include "grit/theme_resources.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void IconLabelBubbleView::Layout() { 79 void IconLabelBubbleView::Layout() {
80 image_->SetBounds(GetBubbleOuterPadding() + 80 image_->SetBounds(GetBubbleOuterPadding() +
81 (is_extension_icon_ ? LocationBarView::kIconInternalPadding : 0), 0, 81 (is_extension_icon_ ? LocationBarView::kIconInternalPadding : 0), 0,
82 image_->GetPreferredSize().width(), height()); 82 image_->GetPreferredSize().width(), height());
83 const int label_height = label_->GetPreferredSize().height(); 83 const int label_height = label_->GetPreferredSize().height();
84 label_->SetBounds(GetPreLabelWidth(), (height() - label_height) / 2, 84 label_->SetBounds(GetPreLabelWidth(), (height() - label_height) / 2,
85 width() - GetNonLabelWidth(), label_height); 85 width() - GetNonLabelWidth(), label_height);
86 } 86 }
87 87
88 void IconLabelBubbleView::SetElideInMiddle(bool elide_in_middle) { 88 void IconLabelBubbleView::SetElideInMiddle(bool elide_in_middle) {
89 label_->SetElideInMiddle(elide_in_middle); 89 label_->SetElideBehavior(
90 elide_in_middle ? views::Label::ELIDE_IN_MIDDLE : views::Label::NO_ELIDE);
90 } 91 }
91 92
92 gfx::Size IconLabelBubbleView::GetNonLabelSize() const { 93 gfx::Size IconLabelBubbleView::GetNonLabelSize() const {
93 return gfx::Size(GetNonLabelWidth(), background_painter_.height()); 94 return gfx::Size(GetNonLabelWidth(), background_painter_.height());
94 } 95 }
95 96
96 int IconLabelBubbleView::GetPreLabelWidth() const { 97 int IconLabelBubbleView::GetPreLabelWidth() const {
97 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 98 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
98 return GetBubbleOuterPadding() + 99 return GetBubbleOuterPadding() +
99 rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)->width() + 100 rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)->width() +
100 LocationBarView::GetItemPadding(); 101 LocationBarView::GetItemPadding();
101 } 102 }
102 103
103 int IconLabelBubbleView::GetNonLabelWidth() const { 104 int IconLabelBubbleView::GetNonLabelWidth() const {
104 return GetPreLabelWidth() + GetBubbleOuterPadding(); 105 return GetPreLabelWidth() + GetBubbleOuterPadding();
105 } 106 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/content_setting_bubble_contents.cc ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698