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

Side by Side Diff: chrome/browser/ui/panels/panel_slide_animation.cc

Issue 8892020: Make Panel tests faster by reducing time intervals in tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/panels/panel_slide_animation.h" 5 #include "chrome/browser/ui/panels/panel_slide_animation.h"
6 6
7 #include "chrome/browser/ui/panels/panel.h" 7 #include "chrome/browser/ui/panels/panel.h"
8 #include "chrome/browser/ui/panels/panel_manager.h"
8 9
9 namespace { 10 namespace {
10 11
11 // These values are experimental and subjective. 12 // These values are experimental and subjective.
12 const int kSetBoundsAnimationMs = 180; 13 const int kSetBoundsAnimationMs = 180;
13 const int kSetBoundsAnimationBigMinimizeMs = 1500; 14 const int kSetBoundsAnimationBigMinimizeMs = 1500;
14 15
15 } 16 }
16 17
17 PanelSlideAnimation::PanelSlideAnimation(ui::AnimationDelegate* target, 18 PanelSlideAnimation::PanelSlideAnimation(ui::AnimationDelegate* target,
(...skipping 12 matching lines...) Expand all
30 if (panel_->expansion_state() == Panel::MINIMIZED) { 31 if (panel_->expansion_state() == Panel::MINIMIZED) {
31 double hidden_title_height = 32 double hidden_title_height =
32 panel_->TitleOnlyHeight() - final_bounds.height(); 33 panel_->TitleOnlyHeight() - final_bounds.height();
33 double distance_y = initial_bounds.height() - final_bounds.height(); 34 double distance_y = initial_bounds.height() - final_bounds.height();
34 animation_stop_to_show_titlebar_ = 1.0 - hidden_title_height / distance_y; 35 animation_stop_to_show_titlebar_ = 1.0 - hidden_title_height / distance_y;
35 if (animation_stop_to_show_titlebar_ > 0.7) { // Relatively big movement. 36 if (animation_stop_to_show_titlebar_ > 0.7) { // Relatively big movement.
36 for_big_minimize_ = true; 37 for_big_minimize_ = true;
37 duration = kSetBoundsAnimationBigMinimizeMs; 38 duration = kSetBoundsAnimationBigMinimizeMs;
38 } 39 }
39 } 40 }
40 SetSlideDuration(duration); 41 SetSlideDuration(PanelManager::AdjustTimeInterval(duration));
41 } 42 }
42 43
43 PanelSlideAnimation::~PanelSlideAnimation() { 44 PanelSlideAnimation::~PanelSlideAnimation() {
44 } 45 }
45 46
46 double PanelSlideAnimation::GetCurrentValue() const { 47 double PanelSlideAnimation::GetCurrentValue() const {
47 double progress = ui::SlideAnimation::GetCurrentValue(); 48 double progress = ui::SlideAnimation::GetCurrentValue();
48 return ComputeAnimationValue(progress, 49 return ComputeAnimationValue(progress,
49 for_big_minimize_, 50 for_big_minimize_,
50 animation_stop_to_show_titlebar_); 51 animation_stop_to_show_titlebar_);
(...skipping 20 matching lines...) Expand all
71 } else if (progress <= kProgressAtFreezeEnd) { 72 } else if (progress <= kProgressAtFreezeEnd) {
72 value = animation_stop_to_show_titlebar; 73 value = animation_stop_to_show_titlebar;
73 } else { 74 } else {
74 value = animation_stop_to_show_titlebar + 75 value = animation_stop_to_show_titlebar +
75 (1.0 - animation_stop_to_show_titlebar) * 76 (1.0 - animation_stop_to_show_titlebar) *
76 ((progress - kProgressAtFreezeEnd) / (1.0 - kProgressAtFreezeEnd)); 77 ((progress - kProgressAtFreezeEnd) / (1.0 - kProgressAtFreezeEnd));
77 } 78 }
78 return value; 79 return value;
79 } 80 }
80 81
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_overflow_strip.cc ('k') | chrome/browser/ui/panels/panel_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698