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

Unified Diff: chrome/browser/ui/cocoa/sprite_view.mm

Issue 1052973004: Stop SpriteView animation when window is miniaturized. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | chrome/browser/ui/cocoa/sprite_view_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/sprite_view.mm
diff --git a/chrome/browser/ui/cocoa/sprite_view.mm b/chrome/browser/ui/cocoa/sprite_view.mm
index a7c31586440c84fae2177464595063743e1ff607..ab18cdf06047d10efb95d215595aca9d575f9976 100644
--- a/chrome/browser/ui/cocoa/sprite_view.mm
+++ b/chrome/browser/ui/cocoa/sprite_view.mm
@@ -73,10 +73,13 @@ static const CGFloat kFrameDuration = 0.03; // 30ms for each animation frame.
// Only animate the sprites if we are attached to a window, and that window
// is not currently minimized or in the middle of a minimize animation.
// http://crbug.com/350329
- if ([self window] && ![[self window] isMiniaturized]) {
- if ([imageLayer_ animationForKey:[spriteAnimation_ keyPath]] == nil)
+ if ([self window] && ![[self window] isMiniaturized] &&
Andre 2015/04/02 21:25:52 This checks if the window is miniaturized. I think
+ ![[notification name] isEqualToString:
+ NSWindowWillMiniaturizeNotification]) {
+ if ([imageLayer_ animationForKey:[spriteAnimation_ keyPath]] == nil) {
[imageLayer_ addAnimation:spriteAnimation_.get()
forKey:[spriteAnimation_ keyPath]];
+ }
} else {
[imageLayer_ removeAnimationForKey:[spriteAnimation_ keyPath]];
}
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/sprite_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698