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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 // Hide the tooltip for click, release, drag, wheel events. | 285 // Hide the tooltip for click, release, drag, wheel events. |
286 if (GetTooltip()->IsVisible()) | 286 if (GetTooltip()->IsVisible()) |
287 GetTooltip()->Hide(); | 287 GetTooltip()->Hide(); |
288 break; | 288 break; |
289 default: | 289 default: |
290 break; | 290 break; |
291 } | 291 } |
292 return false; | 292 return false; |
293 } | 293 } |
294 | 294 |
295 ui::TouchStatus TooltipController::PreHandleTouchEvent( | 295 ui::EventResult TooltipController::PreHandleTouchEvent( |
296 aura::Window* target, | 296 aura::Window* target, |
297 ui::TouchEvent* event) { | 297 ui::TouchEvent* event) { |
298 // TODO(varunjain): need to properly implement tooltips for | 298 // TODO(varunjain): need to properly implement tooltips for |
299 // touch events. | 299 // touch events. |
300 // Hide the tooltip for touch events. | 300 // Hide the tooltip for touch events. |
301 if (GetTooltip()->IsVisible()) | 301 if (GetTooltip()->IsVisible()) |
302 GetTooltip()->Hide(); | 302 GetTooltip()->Hide(); |
303 if (tooltip_window_) | 303 if (tooltip_window_) |
304 tooltip_window_->RemoveObserver(this); | 304 tooltip_window_->RemoveObserver(this); |
305 tooltip_window_ = NULL; | 305 tooltip_window_ = NULL; |
306 return ui::TOUCH_STATUS_UNKNOWN; | 306 return ui::ER_UNHANDLED; |
307 } | 307 } |
308 | 308 |
309 ui::EventResult TooltipController::PreHandleGestureEvent( | 309 ui::EventResult TooltipController::PreHandleGestureEvent( |
310 aura::Window* target, | 310 aura::Window* target, |
311 ui::GestureEvent* event) { | 311 ui::GestureEvent* event) { |
312 return ui::ER_UNHANDLED; | 312 return ui::ER_UNHANDLED; |
313 } | 313 } |
314 | 314 |
315 void TooltipController::OnWindowDestroyed(aura::Window* window) { | 315 void TooltipController::OnWindowDestroyed(aura::Window* window) { |
316 if (tooltip_window_ == window) { | 316 if (tooltip_window_ == window) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 } | 470 } |
471 | 471 |
472 TooltipController::Tooltip* TooltipController::GetTooltip() { | 472 TooltipController::Tooltip* TooltipController::GetTooltip() { |
473 if (!tooltip_.get()) | 473 if (!tooltip_.get()) |
474 tooltip_.reset(new Tooltip); | 474 tooltip_.reset(new Tooltip); |
475 return tooltip_.get(); | 475 return tooltip_.get(); |
476 } | 476 } |
477 | 477 |
478 } // namespace internal | 478 } // namespace internal |
479 } // namespace ash | 479 } // namespace ash |
OLD | NEW |