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/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
10 #include "ui/gfx/screen.h" | 10 #include "ui/gfx/screen.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 namespace views { | 47 namespace views { |
48 namespace corewm { | 48 namespace corewm { |
49 | 49 |
50 TooltipAura::TooltipAura(gfx::ScreenType screen_type) | 50 TooltipAura::TooltipAura(gfx::ScreenType screen_type) |
51 : screen_type_(screen_type), | 51 : screen_type_(screen_type), |
52 widget_(NULL), | 52 widget_(NULL), |
53 tooltip_window_(NULL) { | 53 tooltip_window_(NULL) { |
54 label_.set_owned_by_client(); | 54 label_.set_owned_by_client(); |
55 label_.SetMultiLine(true); | 55 label_.SetMultiLine(true); |
| 56 label_.SetHorizontalAlignment(gfx::ALIGN_TO_HEAD); |
56 | 57 |
57 const int kHorizontalPadding = 3; | 58 const int kHorizontalPadding = 3; |
58 const int kVerticalPadding = 2; | 59 const int kVerticalPadding = 2; |
59 label_.SetBorder(Border::CreateEmptyBorder( | 60 label_.SetBorder(Border::CreateEmptyBorder( |
60 kVerticalPadding, kHorizontalPadding, | 61 kVerticalPadding, kHorizontalPadding, |
61 kVerticalPadding, kHorizontalPadding)); | 62 kVerticalPadding, kHorizontalPadding)); |
62 } | 63 } |
63 | 64 |
64 TooltipAura::~TooltipAura() { | 65 TooltipAura::~TooltipAura() { |
65 DestroyWidget(); | 66 DestroyWidget(); |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 } | 230 } |
230 | 231 |
231 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { | 232 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { |
232 DCHECK_EQ(widget_, widget); | 233 DCHECK_EQ(widget_, widget); |
233 widget_ = NULL; | 234 widget_ = NULL; |
234 tooltip_window_ = NULL; | 235 tooltip_window_ = NULL; |
235 } | 236 } |
236 | 237 |
237 } // namespace corewm | 238 } // namespace corewm |
238 } // namespace views | 239 } // namespace views |
OLD | NEW |