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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 gfx::Screen::GetMonitorAreaNearestPoint(tooltip_rect.origin()); | 193 gfx::Screen::GetMonitorAreaNearestPoint(tooltip_rect.origin()); |
194 widget_->SetBounds(tooltip_rect.AdjustToFit(monitor_bounds)); | 194 widget_->SetBounds(tooltip_rect.AdjustToFit(monitor_bounds)); |
195 } | 195 } |
196 | 196 |
197 }; | 197 }; |
198 | 198 |
199 //////////////////////////////////////////////////////////////////////////////// | 199 //////////////////////////////////////////////////////////////////////////////// |
200 // TooltipController public: | 200 // TooltipController public: |
201 | 201 |
202 TooltipController::TooltipController() | 202 TooltipController::TooltipController() |
203 : aura::EventFilter(NULL), | 203 : tooltip_window_(NULL), |
204 tooltip_window_(NULL), | |
205 tooltip_(new Tooltip), | 204 tooltip_(new Tooltip), |
206 tooltips_enabled_(true) { | 205 tooltips_enabled_(true) { |
207 tooltip_timer_.Start(FROM_HERE, | 206 tooltip_timer_.Start(FROM_HERE, |
208 base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs), | 207 base::TimeDelta::FromMilliseconds(kTooltipTimeoutMs), |
209 this, &TooltipController::TooltipTimerFired); | 208 this, &TooltipController::TooltipTimerFired); |
210 } | 209 } |
211 | 210 |
212 TooltipController::~TooltipController() { | 211 TooltipController::~TooltipController() { |
213 if (tooltip_window_) | 212 if (tooltip_window_) |
214 tooltip_window_->RemoveObserver(this); | 213 tooltip_window_->RemoveObserver(this); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 320 } |
322 } | 321 } |
323 } | 322 } |
324 | 323 |
325 bool TooltipController::IsTooltipVisible() { | 324 bool TooltipController::IsTooltipVisible() { |
326 return tooltip_->IsVisible(); | 325 return tooltip_->IsVisible(); |
327 } | 326 } |
328 | 327 |
329 } // namespace internal | 328 } // namespace internal |
330 } // namespace ash | 329 } // namespace ash |
OLD | NEW |