| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_split.h" | 8 #include "base/strings/string_split.h" |
| 9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 namespace views { | 59 namespace views { |
| 60 namespace corewm { | 60 namespace corewm { |
| 61 | 61 |
| 62 TooltipAura::TooltipAura(gfx::ScreenType screen_type) | 62 TooltipAura::TooltipAura(gfx::ScreenType screen_type) |
| 63 : screen_type_(screen_type), | 63 : screen_type_(screen_type), |
| 64 widget_(NULL), | 64 widget_(NULL), |
| 65 tooltip_window_(NULL) { | 65 tooltip_window_(NULL) { |
| 66 label_.set_background( | 66 label_.set_background( |
| 67 views::Background::CreateSolidBackground(kTooltipBackground)); | 67 views::Background::CreateSolidBackground(kTooltipBackground)); |
| 68 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoDropShadows)) { | 68 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoDropShadows)) { |
| 69 label_.set_border( | 69 label_.SetBorder( |
| 70 views::Border::CreateSolidBorder(kTooltipBorderWidth, | 70 views::Border::CreateSolidBorder(kTooltipBorderWidth, kTooltipBorder)); |
| 71 kTooltipBorder)); | |
| 72 } | 71 } |
| 73 label_.set_owned_by_client(); | 72 label_.set_owned_by_client(); |
| 74 label_.SetMultiLine(true); | 73 label_.SetMultiLine(true); |
| 75 } | 74 } |
| 76 | 75 |
| 77 TooltipAura::~TooltipAura() { | 76 TooltipAura::~TooltipAura() { |
| 78 DestroyWidget(); | 77 DestroyWidget(); |
| 79 } | 78 } |
| 80 | 79 |
| 81 // static | 80 // static |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 263 } |
| 265 | 264 |
| 266 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { | 265 void TooltipAura::OnWidgetDestroying(views::Widget* widget) { |
| 267 DCHECK_EQ(widget_, widget); | 266 DCHECK_EQ(widget_, widget); |
| 268 widget_ = NULL; | 267 widget_ = NULL; |
| 269 tooltip_window_ = NULL; | 268 tooltip_window_ = NULL; |
| 270 } | 269 } |
| 271 | 270 |
| 272 } // namespace corewm | 271 } // namespace corewm |
| 273 } // namespace views | 272 } // namespace views |
| OLD | NEW |