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

Side by Side Diff: chrome/browser/extensions/extension_action.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698