| 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 3fed68aed1badbd094df119d4613f16922aa27c6..678923f0710b206067414f79ff596e407290f03b 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/guest_tag.h"
|
| #include "chrome/browser/task_management/providers/web_contents/panel_tag.h"
|
| #include "chrome/browser/task_management/providers/web_contents/prerender_tag.h"
|
| @@ -14,9 +15,11 @@
|
| #include "chrome/browser/task_management/providers/web_contents/web_contents_tags_manager.h"
|
| #include "components/guest_view/browser/guest_view_base.h"
|
| #include "content/public/browser/web_contents.h"
|
| +#include "extensions/browser/view_type_utils.h"
|
|
|
| #if defined(ENABLE_EXTENSIONS)
|
| #include "chrome/browser/ui/panels/panel.h"
|
| +#include "extensions/browser/process_manager.h"
|
| #endif
|
|
|
| namespace task_management {
|
| @@ -37,6 +40,23 @@ void TagWebContents(content::WebContents* contents,
|
| WebContentsTagsManager::GetInstance()->AddTag(tag);
|
| }
|
|
|
| +#if defined(ENABLE_EXTENSIONS)
|
| +
|
| +bool IsExtensionWebContents(content::WebContents* contents) {
|
| + DCHECK(contents);
|
| +
|
| + if (guest_view::GuestViewBase::IsGuest(contents))
|
| + return false;
|
| +
|
| + extensions::ViewType view_type = extensions::GetViewType(contents);
|
| + return (view_type != extensions::VIEW_TYPE_INVALID &&
|
| + view_type != extensions::VIEW_TYPE_TAB_CONTENTS &&
|
| + view_type != extensions::VIEW_TYPE_BACKGROUND_CONTENTS &&
|
| + view_type != extensions::VIEW_TYPE_PANEL);
|
| +}
|
| +
|
| +#endif // defined(ENABLE_EXTENSIONS)
|
| +
|
| } // namespace
|
| #endif // defined(ENABLE_TASK_MANAGER)
|
|
|
| @@ -130,6 +150,20 @@ void WebContentsTags::CreateForGuestContents(
|
| }
|
|
|
| // static
|
| +void WebContentsTags::CreateForExtension(content::WebContents* web_contents,
|
| + extensions::ViewType view_type) {
|
| +#if defined(ENABLE_TASK_MANAGER) && defined(ENABLE_EXTENSIONS)
|
| + DCHECK(IsExtensionWebContents(web_contents));
|
| +
|
| + if (!WebContentsTag::FromWebContents(web_contents)) {
|
| + TagWebContents(web_contents,
|
| + new ExtensionTag(web_contents, view_type),
|
| + 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);
|
|
|