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

Unified Diff: chrome/browser/ui/panels/panel_window_controller_cocoa.mm

Issue 8826002: Panels: Adding 3-step animation on minimize on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch for landing 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/panels/panel_slide_animation.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/panel_window_controller_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
index 590bc50e69d1c8d84ac3579fe07a631a0cb3f2df..c37fc3f4b1253b72336cdd001f8060dd010936e0 100644
--- a/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_window_controller_cocoa.mm
@@ -28,6 +28,7 @@
#include "chrome/browser/ui/panels/panel_browser_window_cocoa.h"
#include "chrome/browser/ui/panels/panel_manager.h"
#include "chrome/browser/ui/panels/panel_settings_menu_model.h"
+#include "chrome/browser/ui/panels/panel_slide_animation.h"
#import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h"
#include "chrome/browser/ui/toolbar/encoding_menu_controller.h"
#include "chrome/common/chrome_notification_types.h"
@@ -475,31 +476,8 @@ enum {
- (float)animation:(NSAnimation*)animation
valueForProgress:(NSAnimationProgress)progress {
- if (!playingMinimizeAnimation_) {
- // Cubic easing out.
- float value = 1.0 - progress;
- return 1.0 - value * value * value;
- }
-
- // Minimize animation:
- // 1. Quickly (0 -> 0.15) make only titlebar visible.
- // 2. Stay a little bit (0.15->0.6) in place, just showing titlebar.
- // 3. Slowly minimize to thin strip (0.6->1.0)
- const float kAnimationStopAfterQuickDecrease = 0.15;
- const float kAnimationStopAfterShowingTitlebar = 0.6;
- float value;
- if (progress <= kAnimationStopAfterQuickDecrease) {
- value = progress * animationStopToShowTitlebarOnly_ /
- kAnimationStopAfterQuickDecrease;
- } else if (progress <= kAnimationStopAfterShowingTitlebar) {
- value = animationStopToShowTitlebarOnly_;
- } else {
- value = animationStopToShowTitlebarOnly_ +
- (progress - kAnimationStopAfterShowingTitlebar) *
- (1.0 - animationStopToShowTitlebarOnly_) /
- (1.0 - kAnimationStopAfterShowingTitlebar);
- }
- return value;
+ return PanelSlideAnimation::ComputeAnimationValue(
+ progress, playingMinimizeAnimation_, animationStopToShowTitlebarOnly_);
}
- (void)animationDidEnd:(NSAnimation*)animation {
« no previous file with comments | « chrome/browser/ui/panels/panel_slide_animation.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698