OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_action.h" | 5 #include "chrome/browser/extensions/extension_action.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 void DestroyIconAnimation(scoped_ptr<ExtensionAction::IconAnimation>) {} | 387 void DestroyIconAnimation(scoped_ptr<ExtensionAction::IconAnimation>) {} |
388 } | 388 } |
389 void ExtensionAction::RunIconAnimation(int tab_id) { | 389 void ExtensionAction::RunIconAnimation(int tab_id) { |
390 scoped_ptr<IconAnimation> icon_animation(new IconAnimation()); | 390 scoped_ptr<IconAnimation> icon_animation(new IconAnimation()); |
391 icon_animation_[tab_id] = icon_animation->AsWeakPtr(); | 391 icon_animation_[tab_id] = icon_animation->AsWeakPtr(); |
392 icon_animation->Start(); | 392 icon_animation->Start(); |
393 // After the icon is finished fading in (plus some padding to handle random | 393 // After the icon is finished fading in (plus some padding to handle random |
394 // timer delays), destroy it. We use a delayed task so that the Animation is | 394 // timer delays), destroy it. We use a delayed task so that the Animation is |
395 // deleted even if it hasn't finished by the time the MessageLoop is | 395 // deleted even if it hasn't finished by the time the MessageLoop is |
396 // destroyed. | 396 // destroyed. |
397 MessageLoop::current()->PostDelayedTask( | 397 base::MessageLoop::current()->PostDelayedTask( |
398 FROM_HERE, | 398 FROM_HERE, |
399 base::Bind(&DestroyIconAnimation, base::Passed(&icon_animation)), | 399 base::Bind(&DestroyIconAnimation, base::Passed(&icon_animation)), |
400 base::TimeDelta::FromMilliseconds(kIconFadeInDurationMs * 2)); | 400 base::TimeDelta::FromMilliseconds(kIconFadeInDurationMs * 2)); |
401 } | 401 } |
OLD | NEW |