Chromium Code Reviews| Index: chrome/browser/extensions/chrome_extensions_browser_client.cc |
| diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc |
| index 7e22c300184db2ef94a0a288a7016c19e6b68230..00a7b1494ffef6fd91e04fbdd9f85b82abad1517 100644 |
| --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc |
| +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc |
| @@ -31,6 +31,7 @@ |
| #include "chrome/browser/net/chrome_net_log.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/profiles/profile_manager.h" |
| +#include "chrome/browser/task_management/web_contents_tags.h" |
| #include "chrome/common/channel_info.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -345,4 +346,32 @@ void ChromeExtensionsBrowserClient::CleanUpWebView(int embedder_process_id, |
| MenuItem::ExtensionKey("", embedder_process_id, view_instance_id)); |
| } |
| +void ChromeExtensionsBrowserClient::AttachExtensionTaskManagerTag( |
| + content::WebContents* web_contents, |
| + ViewType view_type) { |
| + switch (view_type) { |
| + case VIEW_TYPE_APP_WINDOW: |
| + case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
| + case VIEW_TYPE_EXTENSION_DIALOG: |
| + case VIEW_TYPE_EXTENSION_POPUP: |
| + case VIEW_TYPE_LAUNCHER_PAGE: |
| + case VIEW_TYPE_VIRTUAL_KEYBOARD: |
| + // These are the only types that are tracked by the ExtensionTag. |
| + task_management::WebContentsTags::CreateForExtension(web_contents); |
| + return; |
| + |
| + case VIEW_TYPE_INVALID: |
| + case VIEW_TYPE_BACKGROUND_CONTENTS: |
| + case VIEW_TYPE_PANEL: |
| + case VIEW_TYPE_TAB_CONTENTS: |
|
Devlin
2015/08/04 16:05:07
I think it would be good to document which tags th
afakhry
2015/08/04 18:31:07
The PanelTag will be created in Panel::Initialize(
|
| + // Those types are tracked by other tags, so they're ignored. |
| + return; |
| + |
| + default: |
|
Devlin
2015/08/04 16:05:07
Best to not have a default case. That way, if we
afakhry
2015/08/04 18:31:07
Done.
|
| + // Added new types that are possibly not tracked by the task manager. |
| + NOTREACHED(); |
| + return; |
| + } |
| +} |
| + |
| } // namespace extensions |