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

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

Issue 11043004: Merge 157903 - Turn off animations for page actions and browser actions. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « no previous file | chrome/common/extensions/extension_action_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/extensions/extension_action.h" 5 #include "chrome/common/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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 bool ExtensionAction::SetAppearance(int tab_id, Appearance new_appearance) { 314 bool ExtensionAction::SetAppearance(int tab_id, Appearance new_appearance) {
315 const Appearance old_appearance = GetValue(&appearance_, tab_id); 315 const Appearance old_appearance = GetValue(&appearance_, tab_id);
316 316
317 if (old_appearance == new_appearance) 317 if (old_appearance == new_appearance)
318 return false; 318 return false;
319 319
320 SetValue(&appearance_, tab_id, new_appearance); 320 SetValue(&appearance_, tab_id, new_appearance);
321 321
322 // When showing a badge for the first time on a web page, fade it 322 // When showing a script badge for the first time on a web page, fade it in.
323 // in. Other transitions happen instantly. 323 // Other transitions happen instantly.
324 if (old_appearance == INVISIBLE && tab_id != kDefaultTabId) { 324 if (old_appearance == INVISIBLE && tab_id != kDefaultTabId &&
325 action_type_ == TYPE_SCRIPT_BADGE) {
325 RunIconAnimation(tab_id); 326 RunIconAnimation(tab_id);
326 } 327 }
327 328
328 return true; 329 return true;
329 } 330 }
330 331
331 void ExtensionAction::ClearAllValuesForTab(int tab_id) { 332 void ExtensionAction::ClearAllValuesForTab(int tab_id) {
332 popup_url_.erase(tab_id); 333 popup_url_.erase(tab_id);
333 title_.erase(tab_id); 334 title_.erase(tab_id);
334 icon_.erase(tab_id); 335 icon_.erase(tab_id);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 icon_animation->Start(); 513 icon_animation->Start();
513 // After the icon is finished fading in (plus some padding to handle random 514 // After the icon is finished fading in (plus some padding to handle random
514 // timer delays), destroy it. We use a delayed task so that the Animation is 515 // timer delays), destroy it. We use a delayed task so that the Animation is
515 // deleted even if it hasn't finished by the time the MessageLoop is 516 // deleted even if it hasn't finished by the time the MessageLoop is
516 // destroyed. 517 // destroyed.
517 MessageLoop::current()->PostDelayedTask( 518 MessageLoop::current()->PostDelayedTask(
518 FROM_HERE, 519 FROM_HERE,
519 base::Bind(&DestroyIconAnimation, base::Passed(icon_animation.Pass())), 520 base::Bind(&DestroyIconAnimation, base::Passed(icon_animation.Pass())),
520 base::TimeDelta::FromMilliseconds(kIconFadeInDurationMs * 2)); 521 base::TimeDelta::FromMilliseconds(kIconFadeInDurationMs * 2));
521 } 522 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698