| 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" |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 // schedule the Close here. | 317 // schedule the Close here. |
| 318 CloseSoon(); | 318 CloseSoon(); |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 void ShelfTooltipManager::CancelHidingAnimation() { | 322 void ShelfTooltipManager::CancelHidingAnimation() { |
| 323 if (!widget_ || !widget_->GetNativeView()) | 323 if (!widget_ || !widget_->GetNativeView()) |
| 324 return; | 324 return; |
| 325 | 325 |
| 326 gfx::NativeView native_view = widget_->GetNativeView(); | 326 gfx::NativeView native_view = widget_->GetNativeView(); |
| 327 views::corewm::SetWindowVisibilityAnimationTransition( | 327 wm::SetWindowVisibilityAnimationTransition( |
| 328 native_view, views::corewm::ANIMATE_NONE); | 328 native_view, wm::ANIMATE_NONE); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void ShelfTooltipManager::CloseSoon() { | 331 void ShelfTooltipManager::CloseSoon() { |
| 332 base::MessageLoopForUI::current()->PostTask( | 332 base::MessageLoopForUI::current()->PostTask( |
| 333 FROM_HERE, | 333 FROM_HERE, |
| 334 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); | 334 base::Bind(&ShelfTooltipManager::Close, weak_factory_.GetWeakPtr())); |
| 335 } | 335 } |
| 336 | 336 |
| 337 void ShelfTooltipManager::ShowInternal() { | 337 void ShelfTooltipManager::ShowInternal() { |
| 338 if (view_) | 338 if (view_) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 352 views::BubbleBorder::BOTTOM_CENTER, | 352 views::BubbleBorder::BOTTOM_CENTER, |
| 353 views::BubbleBorder::LEFT_CENTER, | 353 views::BubbleBorder::LEFT_CENTER, |
| 354 views::BubbleBorder::RIGHT_CENTER, | 354 views::BubbleBorder::RIGHT_CENTER, |
| 355 views::BubbleBorder::TOP_CENTER); | 355 views::BubbleBorder::TOP_CENTER); |
| 356 | 356 |
| 357 view_ = new ShelfTooltipBubble(anchor, arrow, this); | 357 view_ = new ShelfTooltipBubble(anchor, arrow, this); |
| 358 widget_ = view_->GetWidget(); | 358 widget_ = view_->GetWidget(); |
| 359 view_->SetText(text_); | 359 view_->SetText(text_); |
| 360 | 360 |
| 361 gfx::NativeView native_view = widget_->GetNativeView(); | 361 gfx::NativeView native_view = widget_->GetNativeView(); |
| 362 views::corewm::SetWindowVisibilityAnimationType( | 362 wm::SetWindowVisibilityAnimationType( |
| 363 native_view, views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); | 363 native_view, wm::WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL); |
| 364 views::corewm::SetWindowVisibilityAnimationTransition( | 364 wm::SetWindowVisibilityAnimationTransition( |
| 365 native_view, views::corewm::ANIMATE_HIDE); | 365 native_view, wm::ANIMATE_HIDE); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void ShelfTooltipManager::CreateTimer(int delay_in_ms) { | 368 void ShelfTooltipManager::CreateTimer(int delay_in_ms) { |
| 369 base::OneShotTimer<ShelfTooltipManager>* new_timer = | 369 base::OneShotTimer<ShelfTooltipManager>* new_timer = |
| 370 new base::OneShotTimer<ShelfTooltipManager>(); | 370 new base::OneShotTimer<ShelfTooltipManager>(); |
| 371 new_timer->Start(FROM_HERE, | 371 new_timer->Start(FROM_HERE, |
| 372 base::TimeDelta::FromMilliseconds(delay_in_ms), | 372 base::TimeDelta::FromMilliseconds(delay_in_ms), |
| 373 this, | 373 this, |
| 374 &ShelfTooltipManager::ShowInternal); | 374 &ShelfTooltipManager::ShowInternal); |
| 375 timer_.reset(new_timer); | 375 timer_.reset(new_timer); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace internal | 378 } // namespace internal |
| 379 } // namespace ash | 379 } // namespace ash |
| OLD | NEW |