| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 params.keep_on_top = true; | 114 params.keep_on_top = true; |
| 115 params.accept_events = false; | 115 params.accept_events = false; |
| 116 params.transparent = true; | 116 params.transparent = true; |
| 117 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 117 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 118 widget->Init(params); | 118 widget->Init(params); |
| 119 return widget; | 119 return widget; |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace | 122 } // namespace |
| 123 | 123 |
| 124 namespace aura_shell { | 124 namespace ash { |
| 125 namespace internal { | 125 namespace internal { |
| 126 | 126 |
| 127 // Displays a widget with tooltip using a views::Label. | 127 // Displays a widget with tooltip using a views::Label. |
| 128 class TooltipController::Tooltip { | 128 class TooltipController::Tooltip { |
| 129 public: | 129 public: |
| 130 Tooltip() { | 130 Tooltip() { |
| 131 label_.set_background( | 131 label_.set_background( |
| 132 views::Background::CreateSolidBackground(kTooltipBackground)); | 132 views::Background::CreateSolidBackground(kTooltipBackground)); |
| 133 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows)) { | 133 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAuraNoShadows)) { |
| 134 label_.set_border( | 134 label_.set_border( |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 string16 tooltip_text(tooltip_text_); | 286 string16 tooltip_text(tooltip_text_); |
| 287 gfx::Point widget_loc = curr_mouse_loc_; | 287 gfx::Point widget_loc = curr_mouse_loc_; |
| 288 widget_loc = widget_loc.Add(tooltip_window_->GetScreenBounds().origin()); | 288 widget_loc = widget_loc.Add(tooltip_window_->GetScreenBounds().origin()); |
| 289 tooltip_->SetText(tooltip_text, widget_loc); | 289 tooltip_->SetText(tooltip_text, widget_loc); |
| 290 tooltip_->Show(); | 290 tooltip_->Show(); |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 } | 293 } |
| 294 | 294 |
| 295 } // namespace internal | 295 } // namespace internal |
| 296 } // namespace aura_shell | 296 } // namespace ash |
| OLD | NEW |