| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf_tooltip_manager.h" | 5 #include "ash/shelf/shelf_tooltip_manager.h" |
| 6 | 6 |
| 7 #include "ash/shelf/shelf_layout_manager.h" | 7 #include "ash/shelf/shelf_layout_manager.h" |
| 8 #include "ash/shelf/shelf_view.h" | 8 #include "ash/shelf/shelf_view.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/window_animations.h" | 11 #include "ash/wm/window_animations.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/message_loop/message_loop.h" | 13 #include "base/thread_task_runner_handle.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "ui/aura/window.h" | 16 #include "ui/aura/window.h" |
| 17 #include "ui/aura/window_event_dispatcher.h" | 17 #include "ui/aura/window_event_dispatcher.h" |
| 18 #include "ui/events/event.h" | 18 #include "ui/events/event.h" |
| 19 #include "ui/events/event_constants.h" | 19 #include "ui/events/event_constants.h" |
| 20 #include "ui/gfx/geometry/insets.h" | 20 #include "ui/gfx/geometry/insets.h" |
| 21 #include "ui/views/bubble/bubble_delegate.h" | 21 #include "ui/views/bubble/bubble_delegate.h" |
| 22 #include "ui/views/bubble/bubble_frame_view.h" | 22 #include "ui/views/bubble/bubble_frame_view.h" |
| 23 #include "ui/views/controls/label.h" | 23 #include "ui/views/controls/label.h" |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 void ShelfTooltipManager::CancelHidingAnimation() { | 319 void ShelfTooltipManager::CancelHidingAnimation() { |
| 320 if (!widget_ || !widget_->GetNativeView()) | 320 if (!widget_ || !widget_->GetNativeView()) |
| 321 return; | 321 return; |
| 322 | 322 |
| 323 gfx::NativeView native_view = widget_->GetNativeView(); | 323 gfx::NativeView native_view = widget_->GetNativeView(); |
| 324 wm::SetWindowVisibilityAnimationTransition( | 324 wm::SetWindowVisibilityAnimationTransition( |
| 325 native_view, wm::ANIMATE_NONE); | 325 native_view, wm::ANIMATE_NONE); |
| 326 } | 326 } |
| 327 | 327 |
| 328 void ShelfTooltipManager::CloseSoon() { | 328 void ShelfTooltipManager::CloseSoon() { |
| 329 base::MessageLoopForUI::current()->PostTask( | 329 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 330 FROM_HERE, | 330 FROM_HERE, |
| 331 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); | 331 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); |
| 332 } | 332 } |
| 333 | 333 |
| 334 void ShelfTooltipManager::ShowInternal() { | 334 void ShelfTooltipManager::ShowInternal() { |
| 335 if (view_) | 335 if (view_) |
| 336 view_->GetWidget()->Show(); | 336 view_->GetWidget()->Show(); |
| 337 | 337 |
| 338 timer_.reset(); | 338 timer_.reset(); |
| 339 } | 339 } |
| (...skipping 25 matching lines...) Expand all Loading... |
| 365 void ShelfTooltipManager::CreateTimer(int delay_in_ms) { | 365 void ShelfTooltipManager::CreateTimer(int delay_in_ms) { |
| 366 base::OneShotTimer* new_timer = new base::OneShotTimer(); | 366 base::OneShotTimer* new_timer = new base::OneShotTimer(); |
| 367 new_timer->Start(FROM_HERE, | 367 new_timer->Start(FROM_HERE, |
| 368 base::TimeDelta::FromMilliseconds(delay_in_ms), | 368 base::TimeDelta::FromMilliseconds(delay_in_ms), |
| 369 this, | 369 this, |
| 370 &ShelfTooltipManager::ShowInternal); | 370 &ShelfTooltipManager::ShowInternal); |
| 371 timer_.reset(new_timer); | 371 timer_.reset(new_timer); |
| 372 } | 372 } |
| 373 | 373 |
| 374 } // namespace ash | 374 } // namespace ash |
| OLD | NEW |