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