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

Unified Diff: ui/views/corewm/tooltip_aura.cc

Issue 2556083002: Don't subtract border from max size for display rect. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/corewm/tooltip_aura.cc
diff --git a/ui/views/corewm/tooltip_aura.cc b/ui/views/corewm/tooltip_aura.cc
index 256a4fbfebb78e00a78dce44c0024e6939d722ad..170a7dd01c9006677d432879af8abb125ac3d79f 100644
--- a/ui/views/corewm/tooltip_aura.cc
+++ b/ui/views/corewm/tooltip_aura.cc
@@ -141,11 +141,13 @@ class TooltipAura::TooltipView : public views::View {
ResetDisplayRect();
}
+ size_t GetLineSizeForTest() const {
+ return render_text_->line_size_for_test();
+ }
+
private:
void ResetDisplayRect() {
- gfx::Insets insets = border()->GetInsets();
- int max_text_width = max_width_ - insets.width();
- render_text_->SetDisplayRect(gfx::Rect(0, 0, max_text_width, 100000));
+ render_text_->SetDisplayRect(gfx::Rect(0, 0, max_width_, 100000));
}
std::unique_ptr<gfx::RenderText> render_text_;
@@ -164,6 +166,10 @@ TooltipAura::~TooltipAura() {
DestroyWidget();
}
+size_t TooltipAura::GetLineSizeForTest() const {
+ return tooltip_view_->GetLineSizeForTest();
+}
+
void TooltipAura::SetTooltipBounds(const gfx::Point& mouse_pos,
const gfx::Size& tooltip_size) {
gfx::Rect tooltip_rect(mouse_pos, tooltip_size);

Powered by Google App Engine
This is Rietveld 408576698