Chromium Code Reviews| Index: chrome/browser/task_management/web_contents_tags.cc |
| diff --git a/chrome/browser/task_management/web_contents_tags.cc b/chrome/browser/task_management/web_contents_tags.cc |
| index 00f1a75d84ffdd57a7aa9a4b14efef3dd6502de0..fb5d6f258146f69ff08d1f1d1987315f9f86dfb6 100644 |
| --- a/chrome/browser/task_management/web_contents_tags.cc |
| +++ b/chrome/browser/task_management/web_contents_tags.cc |
| @@ -6,6 +6,7 @@ |
| #include "chrome/browser/task_management/providers/web_contents/background_contents_tag.h" |
| #include "chrome/browser/task_management/providers/web_contents/devtools_tag.h" |
| +#include "chrome/browser/task_management/providers/web_contents/extension_tag.h" |
| #include "chrome/browser/task_management/providers/web_contents/panel_tag.h" |
| #include "chrome/browser/task_management/providers/web_contents/prerender_tag.h" |
| #include "chrome/browser/task_management/providers/web_contents/tab_contents_tag.h" |
| @@ -102,6 +103,24 @@ void WebContentsTags::CreateForPanel(content::WebContents* web_contents, |
| } |
| // static |
| +void WebContentsTags::CreateForExtension( |
| + content::WebContents* web_contents, |
| + const extensions::Extension* extension) { |
| +#if defined(ENABLE_TASK_MANAGER) && defined(ENABLE_EXTENSIONS) |
| + DCHECK(extension); |
| + |
| + if (!ExtensionTag::IsAllowedToTag(web_contents)) |
| + return; |
|
afakhry
2015/07/25 00:50:40
Not liking having to do this check every time this
ncarter (slow)
2015/07/27 19:42:35
I agree, this isn't great. At the very least we co
|
| + |
| + if (!WebContentsTag::FromWebContents(web_contents)) { |
| + TagWebContents(web_contents, |
| + new ExtensionTag(web_contents, extension), |
| + WebContentsTag::kTagKey); |
| + } |
| +#endif // defined(ENABLE_TASK_MANAGER) && defined(ENABLE_EXTENSIONS) |
| +} |
| + |
| +// static |
| void WebContentsTags::ClearTag(content::WebContents* web_contents) { |
| #if defined(ENABLE_TASK_MANAGER) |
| const WebContentsTag* tag = WebContentsTag::FromWebContents(web_contents); |