From 981b34450805e070b6694c8df292f24ee1f73ff4 Mon Sep 17 00:00:00 2001 From: "jcivelli@chromium.org" Date: Mon, 17 May 2010 21:46:31 +0000 Subject: Disable app launcher animation on ChromeOS. It causing the app launcher to resize to a wrong size. BUG=None TEST=On ChromeOS, press the new tab button, the app launcher should show correctly. Review URL: http://codereview.chromium.org/2108007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47460 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/app_launcher.cc | 11 +++++++++++ chrome/browser/views/app_launcher.h | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/chrome/browser/views/app_launcher.cc b/chrome/browser/views/app_launcher.cc index e993cdc..5ee038d 100644 --- a/chrome/browser/views/app_launcher.cc +++ b/chrome/browser/views/app_launcher.cc @@ -249,8 +249,13 @@ AppLauncher::AppLauncher(Browser* browser) info_bubble_(NULL) { DCHECK(browser); info_bubble_content_ = new InfoBubbleContentsView(this); +#if defined(OS_WIN) + animate_ = true; animation_.reset(new SlideAnimation(this)); animation_->SetTweenType(Tween::LINEAR); +#else + animate_ = false; +#endif } AppLauncher::~AppLauncher() { @@ -332,6 +337,12 @@ void AppLauncher::UpdatePreferredSize(const gfx::Size& pref_size) { previous_contents_pref_size_ = contents_pref_size_; contents_pref_size_ = pref_size; + if (!animate_) { + info_bubble_content_->ComputePreferredSize(pref_size); + info_bubble_->SizeToContents(); + return; + } + int original_height = previous_contents_pref_size_.height(); int new_height = contents_pref_size_.height(); int new_duration; diff --git a/chrome/browser/views/app_launcher.h b/chrome/browser/views/app_launcher.h index 8891ec6..a9cbf1d 100644 --- a/chrome/browser/views/app_launcher.h +++ b/chrome/browser/views/app_launcher.h @@ -130,9 +130,12 @@ class AppLauncher : public AnimationDelegate, // The previous preferred size of the DOM contents. gfx::Size previous_contents_pref_size_; + // Whether we should use an animation when showing the info-bubble. + bool animate_; + // The animation that grows the info-bubble. scoped_ptr animation_; - + DISALLOW_COPY_AND_ASSIGN(AppLauncher); }; -- cgit v1.1