| Index: chrome/browser/task_management/providers/web_contents/extension_task.cc
|
| diff --git a/chrome/browser/task_management/providers/web_contents/extension_task.cc b/chrome/browser/task_management/providers/web_contents/extension_task.cc
|
| index 9e6da132398dc92de57dfc0a6d46ab3a8f4b768e..f523a6182e3c7bf4691d34abad0eea7304e5fef0 100644
|
| --- a/chrome/browser/task_management/providers/web_contents/extension_task.cc
|
| +++ b/chrome/browser/task_management/providers/web_contents/extension_task.cc
|
| @@ -5,8 +5,13 @@
|
| #include "chrome/browser/task_management/providers/web_contents/extension_task.h"
|
|
|
| #include "base/strings/utf_string_conversions.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/ui/browser.h"
|
| +#include "chrome/browser/ui/browser_finder.h"
|
| +#include "chrome/browser/ui/chrome_pages.h"
|
| #include "content/public/browser/browser_context.h"
|
| #include "content/public/browser/web_contents.h"
|
| +#include "extensions/browser/process_manager.h"
|
| #include "extensions/browser/view_type_utils.h"
|
| #include "extensions/common/constants.h"
|
| #include "extensions/common/extension.h"
|
| @@ -58,6 +63,32 @@ void ExtensionTask::UpdateFavicon() {
|
| // extension.
|
| }
|
|
|
| +void ExtensionTask::Activate() {
|
| + // This task represents the extension view of (for example) a background page
|
| + // or browser action button, so there is no top-level window to bring to the
|
| + // front. Instead, when this task is double-clicked, we bring up the
|
| + // chrome://extensions page in a tab, and highlight the details for this
|
| + // extension.
|
| + //
|
| + // TODO(nick): For extensions::VIEW_TYPE_APP_WINDOW, and maybe others, there
|
| + // may actually be a window we could focus. Special case those here as needed.
|
| + const extensions::Extension* extension =
|
| + extensions::ProcessManager::Get(web_contents()->GetBrowserContext())
|
| + ->GetExtensionForWebContents(web_contents());
|
| +
|
| + if (!extension)
|
| + return;
|
| +
|
| + Browser* browser = chrome::FindTabbedBrowser(
|
| + Profile::FromBrowserContext(web_contents()->GetBrowserContext()), true);
|
| +
|
| + // If an existing browser isn't found, don't create a new one.
|
| + if (!browser)
|
| + return;
|
| +
|
| + chrome::ShowExtensions(browser, extension->id());
|
| +}
|
| +
|
| Task::Type ExtensionTask::GetType() const {
|
| return Task::EXTENSION;
|
| }
|
|
|