OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/task_manager/providers/web_contents/extension_tag.h" | 5 #include "chrome/browser/task_manager/providers/web_contents/extension_tag.h" |
6 | 6 |
7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
| 8 #include "extensions/features/features.h" |
8 | 9 |
9 #if defined(ENABLE_EXTENSIONS) | 10 #if BUILDFLAG(ENABLE_EXTENSIONS) |
10 #include "extensions/browser/process_manager.h" | 11 #include "extensions/browser/process_manager.h" |
11 #endif | 12 #endif |
12 | 13 |
13 namespace task_manager { | 14 namespace task_manager { |
14 | 15 |
15 ExtensionTask* ExtensionTag::CreateTask() const { | 16 ExtensionTask* ExtensionTag::CreateTask() const { |
16 // Upon being asked to create a task, it means that the site instance is ready | 17 // Upon being asked to create a task, it means that the site instance is ready |
17 // and connected, and the render frames have been initialized. | 18 // and connected, and the render frames have been initialized. |
18 // It's OK if the following returns nullptr, ExtensionTask will then get the | 19 // It's OK if the following returns nullptr, ExtensionTask will then get the |
19 // title from the WebContents. | 20 // title from the WebContents. |
20 const extensions::Extension* extension = | 21 const extensions::Extension* extension = |
21 extensions::ProcessManager::Get(web_contents()->GetBrowserContext())-> | 22 extensions::ProcessManager::Get(web_contents()->GetBrowserContext())-> |
22 GetExtensionForWebContents(web_contents()); | 23 GetExtensionForWebContents(web_contents()); |
23 | 24 |
24 return new ExtensionTask(web_contents(), extension, view_type_); | 25 return new ExtensionTask(web_contents(), extension, view_type_); |
25 } | 26 } |
26 | 27 |
27 ExtensionTag::ExtensionTag(content::WebContents* web_contents, | 28 ExtensionTag::ExtensionTag(content::WebContents* web_contents, |
28 const extensions::ViewType view_type) | 29 const extensions::ViewType view_type) |
29 : WebContentsTag(web_contents), | 30 : WebContentsTag(web_contents), |
30 view_type_(view_type) { | 31 view_type_(view_type) { |
31 } | 32 } |
32 | 33 |
33 ExtensionTag::~ExtensionTag() { | 34 ExtensionTag::~ExtensionTag() { |
34 } | 35 } |
35 | 36 |
36 } // namespace task_manager | 37 } // namespace task_manager |
OLD | NEW |