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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 // Hide the tooltip for click, release, drag, wheel events. | 294 // Hide the tooltip for click, release, drag, wheel events. |
295 if (GetTooltip()->IsVisible()) | 295 if (GetTooltip()->IsVisible()) |
296 GetTooltip()->Hide(); | 296 GetTooltip()->Hide(); |
297 break; | 297 break; |
298 default: | 298 default: |
299 break; | 299 break; |
300 } | 300 } |
301 return false; | 301 return false; |
302 } | 302 } |
303 | 303 |
304 ui::TouchStatus TooltipController::PreHandleTouchEvent( | 304 ui::EventResult TooltipController::PreHandleTouchEvent( |
305 aura::Window* target, | 305 aura::Window* target, |
306 ui::TouchEvent* event) { | 306 ui::TouchEvent* event) { |
307 // TODO(varunjain): need to properly implement tooltips for | 307 // TODO(varunjain): need to properly implement tooltips for |
308 // touch events. | 308 // touch events. |
309 // Hide the tooltip for touch events. | 309 // Hide the tooltip for touch events. |
310 if (GetTooltip()->IsVisible()) | 310 if (GetTooltip()->IsVisible()) |
311 GetTooltip()->Hide(); | 311 GetTooltip()->Hide(); |
312 if (tooltip_window_) | 312 if (tooltip_window_) |
313 tooltip_window_->RemoveObserver(this); | 313 tooltip_window_->RemoveObserver(this); |
314 tooltip_window_ = NULL; | 314 tooltip_window_ = NULL; |
315 return ui::TOUCH_STATUS_UNKNOWN; | 315 return ui::ER_UNHANDLED; |
316 } | 316 } |
317 | 317 |
318 ui::EventResult TooltipController::PreHandleGestureEvent( | 318 ui::EventResult TooltipController::PreHandleGestureEvent( |
319 aura::Window* target, | 319 aura::Window* target, |
320 ui::GestureEvent* event) { | 320 ui::GestureEvent* event) { |
321 return ui::ER_UNHANDLED; | 321 return ui::ER_UNHANDLED; |
322 } | 322 } |
323 | 323 |
324 void TooltipController::OnWindowDestroyed(aura::Window* window) { | 324 void TooltipController::OnWindowDestroyed(aura::Window* window) { |
325 if (tooltip_window_ == window) { | 325 if (tooltip_window_ == window) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 } | 479 } |
480 | 480 |
481 TooltipController::Tooltip* TooltipController::GetTooltip() { | 481 TooltipController::Tooltip* TooltipController::GetTooltip() { |
482 if (!tooltip_.get()) | 482 if (!tooltip_.get()) |
483 tooltip_.reset(new Tooltip(this)); | 483 tooltip_.reset(new Tooltip(this)); |
484 return tooltip_.get(); | 484 return tooltip_.get(); |
485 } | 485 } |
486 | 486 |
487 } // namespace internal | 487 } // namespace internal |
488 } // namespace ash | 488 } // namespace ash |
OLD | NEW |