| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // TODO(oshima): Consider to use views::Label. | 67 // TODO(oshima): Consider to use views::Label. |
| 68 class TooltipAura::TooltipView : public views::View { | 68 class TooltipAura::TooltipView : public views::View { |
| 69 public: | 69 public: |
| 70 TooltipView() | 70 TooltipView() |
| 71 : render_text_(gfx::RenderText::CreateInstance()), | 71 : render_text_(gfx::RenderText::CreateInstance()), |
| 72 max_width_(0) { | 72 max_width_(0) { |
| 73 const int kHorizontalPadding = 8; | 73 const int kHorizontalPadding = 8; |
| 74 const int kVerticalPaddingTop = 4; | 74 const int kVerticalPaddingTop = 4; |
| 75 const int kVerticalPaddingBottom = 5; | 75 const int kVerticalPaddingBottom = 5; |
| 76 SetBorder(Border::CreateEmptyBorder(kVerticalPaddingTop, kHorizontalPadding, | 76 SetBorder(CreateEmptyBorder(kVerticalPaddingTop, kHorizontalPadding, |
| 77 kVerticalPaddingBottom, | 77 kVerticalPaddingBottom, kHorizontalPadding)); |
| 78 kHorizontalPadding)); | |
| 79 | 78 |
| 80 set_owned_by_client(); | 79 set_owned_by_client(); |
| 81 render_text_->SetWordWrapBehavior(gfx::WRAP_LONG_WORDS); | 80 render_text_->SetWordWrapBehavior(gfx::WRAP_LONG_WORDS); |
| 82 render_text_->SetMultiline(true); | 81 render_text_->SetMultiline(true); |
| 83 | 82 |
| 84 ResetDisplayRect(); | 83 ResetDisplayRect(); |
| 85 } | 84 } |
| 86 | 85 |
| 87 ~TooltipView() override {} | 86 ~TooltipView() override {} |
| 88 | 87 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 241 } |
| 243 | 242 |
| 244 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { | 243 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { |
| 245 DCHECK_EQ(widget_, widget); | 244 DCHECK_EQ(widget_, widget); |
| 246 widget_ = NULL; | 245 widget_ = NULL; |
| 247 tooltip_window_ = NULL; | 246 tooltip_window_ = NULL; |
| 248 } | 247 } |
| 249 | 248 |
| 250 } // namespace corewm | 249 } // namespace corewm |
| 251 } // namespace views | 250 } // namespace views |
| OLD | NEW |