Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1934)

Unified Diff: ash/launcher/launcher_tooltip_manager.cc

Issue 10824059: Fixees launcher tooltip animation settings and its finer visibility bugs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/launcher/launcher_tooltip_manager.h ('k') | ash/launcher/launcher_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/launcher_tooltip_manager.cc
diff --git a/ash/launcher/launcher_tooltip_manager.cc b/ash/launcher/launcher_tooltip_manager.cc
index 686318d32d8cbc897024eb24d32f26ad43f6b4eb..4e7c6961e88dcfd001c4282ae0f8167198ff03c0 100644
--- a/ash/launcher/launcher_tooltip_manager.cc
+++ b/ash/launcher/launcher_tooltip_manager.cc
@@ -58,7 +58,7 @@ class LauncherTooltipManager::LauncherTooltipBubble
void Close();
private:
- // views::WidgetDelegate overrides;
+ // views::WidgetDelegate overrides:
virtual void WindowClosing() OVERRIDE;
LauncherTooltipManager* host_;
@@ -82,7 +82,7 @@ LauncherTooltipManager::LauncherTooltipBubble::LauncherTooltipBubble(
aura::RootWindow* root_window =
anchor->GetWidget()->GetNativeView()->GetRootWindow();
set_parent_window(ash::Shell::GetInstance()->GetContainer(
- root_window, ash::internal::kShellWindowId_LauncherContainer));
+ root_window, ash::internal::kShellWindowId_SettingBubbleContainer));
}
label_ = new views::Label;
label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
@@ -127,6 +127,7 @@ LauncherTooltipManager::LauncherTooltipManager(
}
LauncherTooltipManager::~LauncherTooltipManager() {
+ CancelHidingAnimation();
Close();
if (shelf_layout_manager_)
shelf_layout_manager_->RemoveObserver(this);
@@ -139,18 +140,16 @@ void LauncherTooltipManager::ShowDelayed(views::View* anchor,
if (view_) {
if (timer_.get() && timer_->IsRunning())
return;
- else
+ else {
+ CancelHidingAnimation();
Close();
+ }
}
if (shelf_layout_manager_ && !shelf_layout_manager_->IsVisible())
return;
CreateBubble(anchor, text);
- gfx::NativeView native_view = widget_->GetNativeView();
- SetWindowVisibilityAnimationType(
- native_view, WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
- SetWindowVisibilityAnimationTransition(native_view, ANIMATE_SHOW);
ResetTimer();
}
@@ -159,6 +158,7 @@ void LauncherTooltipManager::ShowImmediately(views::View* anchor,
if (view_) {
if (timer_.get() && timer_->IsRunning())
StopTimer();
+ CancelHidingAnimation();
Close();
}
@@ -166,12 +166,11 @@ void LauncherTooltipManager::ShowImmediately(views::View* anchor,
return;
CreateBubble(anchor, text);
- gfx::NativeView native_view = widget_->GetNativeView();
- SetWindowVisibilityAnimationTransition(native_view, ANIMATE_NONE);
ShowInternal();
}
void LauncherTooltipManager::Close() {
+ StopTimer();
if (view_) {
view_->Close();
view_ = NULL;
@@ -192,6 +191,7 @@ void LauncherTooltipManager::SetArrowLocation(ShelfAlignment alignment) {
alignment_ = alignment;
if (view_) {
+ CancelHidingAnimation();
Close();
ShowImmediately(anchor_, text_);
}
@@ -310,6 +310,14 @@ void LauncherTooltipManager::OnAutoHideStateChanged(
}
}
+void LauncherTooltipManager::CancelHidingAnimation() {
+ if (!widget_ || !widget_->GetNativeView())
+ return;
+
+ gfx::NativeView native_view = widget_->GetNativeView();
+ SetWindowVisibilityAnimationTransition(native_view, ANIMATE_NONE);
+}
+
void LauncherTooltipManager::CloseSoon() {
MessageLoopForUI::current()->PostTask(
FROM_HERE,
@@ -334,6 +342,11 @@ void LauncherTooltipManager::CreateBubble(views::View* anchor,
views::BubbleDelegateView::CreateBubble(view_);
widget_ = view_->GetWidget();
view_->SetText(text_);
+
+ gfx::NativeView native_view = widget_->GetNativeView();
+ SetWindowVisibilityAnimationType(
+ native_view, WINDOW_VISIBILITY_ANIMATION_TYPE_VERTICAL);
+ SetWindowVisibilityAnimationTransition(native_view, ANIMATE_HIDE);
}
} // namespace internal
« no previous file with comments | « ash/launcher/launcher_tooltip_manager.h ('k') | ash/launcher/launcher_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698