| 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_icon_factory.h" | 5 #include "chrome/browser/extensions/extension_action_icon_factory.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_action.h" | 7 #include "chrome/browser/extensions/extension_action.h" |
| 8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/extensions/extension_icon_set.h" | 9 #include "chrome/common/extensions/extension_icon_set.h" |
| 10 #include "grit/theme_resources.h" | 10 #include "grit/theme_resources.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 gfx::Image ExtensionActionIconFactory::GetIcon(int tab_id) { | 53 gfx::Image ExtensionActionIconFactory::GetIcon(int tab_id) { |
| 54 gfx::ImageSkia base_icon = GetBaseIconFromAction(tab_id); | 54 gfx::ImageSkia base_icon = GetBaseIconFromAction(tab_id); |
| 55 return action_->ApplyAttentionAndAnimation(base_icon, tab_id); | 55 return action_->ApplyAttentionAndAnimation(base_icon, tab_id); |
| 56 } | 56 } |
| 57 | 57 |
| 58 gfx::ImageSkia ExtensionActionIconFactory::GetBaseIconFromAction(int tab_id) { | 58 gfx::ImageSkia ExtensionActionIconFactory::GetBaseIconFromAction(int tab_id) { |
| 59 gfx::ImageSkia icon = action_->GetExplicitlySetIcon(tab_id); | 59 gfx::ImageSkia icon = action_->GetExplicitlySetIcon(tab_id); |
| 60 if (!icon.isNull()) | 60 if (!icon.isNull()) |
| 61 return icon; | 61 return icon; |
| 62 | 62 |
| 63 if (default_icon_.get()) | 63 if (default_icon_) |
| 64 return default_icon_->image_skia(); | 64 return default_icon_->image_skia(); |
| 65 | 65 |
| 66 return GetDefaultIcon(); | 66 return GetDefaultIcon(); |
| 67 } | 67 } |
| OLD | NEW |