| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/corewm/tooltip_aura.h" | 5 #include "ui/views/corewm/tooltip_aura.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 ResetDisplayRect(); | 111 ResetDisplayRect(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 void ResetDisplayRect() { | 115 void ResetDisplayRect() { |
| 116 gfx::Insets insets = border()->GetInsets(); | 116 gfx::Insets insets = border()->GetInsets(); |
| 117 int max_text_width = max_width_ - insets.width(); | 117 int max_text_width = max_width_ - insets.width(); |
| 118 render_text_->SetDisplayRect(gfx::Rect(0, 0, max_text_width, 100000)); | 118 render_text_->SetDisplayRect(gfx::Rect(0, 0, max_text_width, 100000)); |
| 119 } | 119 } |
| 120 | 120 |
| 121 scoped_ptr<gfx::RenderText> render_text_; | 121 std::unique_ptr<gfx::RenderText> render_text_; |
| 122 int max_width_; | 122 int max_width_; |
| 123 | 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(TooltipView); | 124 DISALLOW_COPY_AND_ASSIGN(TooltipView); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 TooltipAura::TooltipAura() | 127 TooltipAura::TooltipAura() |
| 128 : tooltip_view_(new TooltipView), | 128 : tooltip_view_(new TooltipView), |
| 129 widget_(NULL), | 129 widget_(NULL), |
| 130 tooltip_window_(NULL) { | 130 tooltip_window_(NULL) { |
| 131 } | 131 } |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 213 } |
| 214 | 214 |
| 215 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { | 215 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { |
| 216 DCHECK_EQ(widget_, widget); | 216 DCHECK_EQ(widget_, widget); |
| 217 widget_ = NULL; | 217 widget_ = NULL; |
| 218 tooltip_window_ = NULL; | 218 tooltip_window_ = NULL; |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace corewm | 221 } // namespace corewm |
| 222 } // namespace views | 222 } // namespace views |
| OLD | NEW |