| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/tooltips/tooltip_controller.h" | 5 #include "ash/tooltips/tooltip_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 class TooltipController::Tooltip { | 92 class TooltipController::Tooltip { |
| 93 public: | 93 public: |
| 94 Tooltip() { | 94 Tooltip() { |
| 95 label_.set_background( | 95 label_.set_background( |
| 96 views::Background::CreateSolidBackground(kTooltipBackground)); | 96 views::Background::CreateSolidBackground(kTooltipBackground)); |
| 97 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows)) { | 97 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows)) { |
| 98 label_.set_border( | 98 label_.set_border( |
| 99 views::Border::CreateSolidBorder(kTooltipBorderWidth, | 99 views::Border::CreateSolidBorder(kTooltipBorderWidth, |
| 100 kTooltipBorder)); | 100 kTooltipBorder)); |
| 101 } | 101 } |
| 102 label_.set_parent_owned(false); | 102 label_.set_owned_by_client(); |
| 103 widget_.reset(CreateTooltip()); | 103 widget_.reset(CreateTooltip()); |
| 104 widget_->SetContentsView(&label_); | 104 widget_->SetContentsView(&label_); |
| 105 widget_->Activate(); | 105 widget_->Activate(); |
| 106 } | 106 } |
| 107 | 107 |
| 108 ~Tooltip() { | 108 ~Tooltip() { |
| 109 widget_->Close(); | 109 widget_->Close(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 // Updates the text on the tooltip and resizes to fit. | 112 // Updates the text on the tooltip and resizes to fit. |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 bool TooltipController::IsDragDropInProgress() { | 420 bool TooltipController::IsDragDropInProgress() { |
| 421 aura::client::DragDropClient* client = aura::client::GetDragDropClient( | 421 aura::client::DragDropClient* client = aura::client::GetDragDropClient( |
| 422 Shell::GetRootWindow()); | 422 Shell::GetRootWindow()); |
| 423 if (client) | 423 if (client) |
| 424 return client->IsDragDropInProgress(); | 424 return client->IsDragDropInProgress(); |
| 425 return false; | 425 return false; |
| 426 } | 426 } |
| 427 | 427 |
| 428 } // namespace internal | 428 } // namespace internal |
| 429 } // namespace ash | 429 } // namespace ash |
| OLD | NEW |