| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // touch events. | 263 // touch events. |
| 264 // Hide the tooltip for touch events. | 264 // Hide the tooltip for touch events. |
| 265 if (tooltip_->IsVisible()) | 265 if (tooltip_->IsVisible()) |
| 266 tooltip_->Hide(); | 266 tooltip_->Hide(); |
| 267 if (tooltip_window_) | 267 if (tooltip_window_) |
| 268 tooltip_window_->RemoveObserver(this); | 268 tooltip_window_->RemoveObserver(this); |
| 269 tooltip_window_ = NULL; | 269 tooltip_window_ = NULL; |
| 270 return ui::TOUCH_STATUS_UNKNOWN; | 270 return ui::TOUCH_STATUS_UNKNOWN; |
| 271 } | 271 } |
| 272 | 272 |
| 273 ui::GestureStatus TooltipController::PreHandleGestureEvent( |
| 274 aura::Window* target, |
| 275 aura::GestureEvent* event) { |
| 276 return ui::GESTURE_STATUS_UNKNOWN; |
| 277 } |
| 278 |
| 273 void TooltipController::OnWindowDestroyed(aura::Window* window) { | 279 void TooltipController::OnWindowDestroyed(aura::Window* window) { |
| 274 if (tooltip_window_ == window) { | 280 if (tooltip_window_ == window) { |
| 275 tooltip_window_->RemoveObserver(this); | 281 tooltip_window_->RemoveObserver(this); |
| 276 tooltip_window_ = NULL; | 282 tooltip_window_ = NULL; |
| 277 } | 283 } |
| 278 } | 284 } |
| 279 | 285 |
| 280 void TooltipController::TooltipTimerFired() { | 286 void TooltipController::TooltipTimerFired() { |
| 281 UpdateIfRequired(); | 287 UpdateIfRequired(); |
| 282 } | 288 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 295 gfx::Point widget_loc = curr_mouse_loc_; | 301 gfx::Point widget_loc = curr_mouse_loc_; |
| 296 widget_loc = widget_loc.Add(tooltip_window_->GetScreenBounds().origin()); | 302 widget_loc = widget_loc.Add(tooltip_window_->GetScreenBounds().origin()); |
| 297 tooltip_->SetText(tooltip_text, widget_loc); | 303 tooltip_->SetText(tooltip_text, widget_loc); |
| 298 tooltip_->Show(); | 304 tooltip_->Show(); |
| 299 } | 305 } |
| 300 } | 306 } |
| 301 } | 307 } |
| 302 | 308 |
| 303 } // namespace internal | 309 } // namespace internal |
| 304 } // namespace ash | 310 } // namespace ash |
| OLD | NEW |