Chromium Code Reviews| Index: chrome/browser/extensions/extension_tab_helper.cc |
| diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc |
| index 6ec0221e59a84f62b5a5a49e9757a8cdf9d1851b..ae1be4dc89a97e32c76654db654d96f95efaf82e 100644 |
| --- a/chrome/browser/extensions/extension_tab_helper.cc |
| +++ b/chrome/browser/extensions/extension_tab_helper.cc |
| @@ -64,23 +64,36 @@ void ExtensionTabHelper::SetExtensionApp(const Extension* extension) { |
| content::NotificationService::NoDetails()); |
| } |
| -void ExtensionTabHelper::SetExtensionAppById( |
| +const Extension* ExtensionTabHelper::GetExtension( |
|
sky
2012/03/05 15:20:25
Make order match header.
stevenjb
2012/03/05 19:50:06
Done.
|
| const std::string& extension_app_id) { |
| if (extension_app_id.empty()) |
| - return; |
| + return NULL; |
| Profile* profile = |
| Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| ExtensionService* extension_service = profile->GetExtensionService(); |
| if (!extension_service || !extension_service->is_ready()) |
| - return; |
| + return NULL; |
| const Extension* extension = |
| extension_service->GetExtensionById(extension_app_id, false); |
| + return extension; |
| +} |
| + |
| +void ExtensionTabHelper::SetExtensionAppById( |
| + const std::string& extension_app_id) { |
| + const Extension* extension = GetExtension(extension_app_id); |
| if (extension) |
| SetExtensionApp(extension); |
| } |
| +void ExtensionTabHelper::SetExtensionAppIconById( |
| + const std::string& extension_app_id) { |
| + const Extension* extension = GetExtension(extension_app_id); |
| + if (extension) |
| + UpdateExtensionAppIcon(extension); |
| +} |
| + |
| SkBitmap* ExtensionTabHelper::GetExtensionAppIcon() { |
| if (extension_app_icon_.empty()) |
| return NULL; |