OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extension_information.h" | 5 #include "chrome/browser/task_manager/extension_information.h" |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/guest_view/guest_view_base.h" |
10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
12 #include "chrome/browser/task_manager/renderer_resource.h" | 13 #include "chrome/browser/task_manager/renderer_resource.h" |
13 #include "chrome/browser/task_manager/task_manager_util.h" | 14 #include "chrome/browser/task_manager/task_manager_util.h" |
14 #include "content/public/browser/render_frame_host.h" | 15 #include "content/public/browser/render_frame_host.h" |
15 #include "content/public/browser/render_process_host.h" | 16 #include "content/public/browser/render_process_host.h" |
16 #include "content/public/browser/render_view_host.h" | 17 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
18 #include "extensions/browser/extension_system.h" | 19 #include "extensions/browser/extension_system.h" |
19 #include "extensions/browser/process_manager.h" | 20 #include "extensions/browser/process_manager.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 if (CheckOwnership(web_contents)) | 141 if (CheckOwnership(web_contents)) |
141 callback.Run(web_contents); | 142 callback.Run(web_contents); |
142 } | 143 } |
143 } | 144 } |
144 } | 145 } |
145 } | 146 } |
146 | 147 |
147 bool ExtensionInformation::CheckOwnership(WebContents* web_contents) { | 148 bool ExtensionInformation::CheckOwnership(WebContents* web_contents) { |
148 // Don't add WebContents that belong to a guest (those are handled by | 149 // Don't add WebContents that belong to a guest (those are handled by |
149 // GuestInformation). Otherwise they will be added twice. | 150 // GuestInformation). Otherwise they will be added twice. |
150 if (web_contents->GetRenderProcessHost()->IsGuest()) | 151 if (GuestViewBase::IsGuest(web_contents)) |
151 return false; | 152 return false; |
152 | 153 |
153 // Extension WebContents tracked by this class will always host extension | 154 // Extension WebContents tracked by this class will always host extension |
154 // content. | 155 // content. |
155 if (!GetExtensionForWebContents(web_contents)) | 156 if (!GetExtensionForWebContents(web_contents)) |
156 return false; | 157 return false; |
157 | 158 |
158 extensions::ViewType view_type = extensions::GetViewType(web_contents); | 159 extensions::ViewType view_type = extensions::GetViewType(web_contents); |
159 | 160 |
160 // Don't add tab contents (those are handled by TabContentsResourceProvider) | 161 // Don't add tab contents (those are handled by TabContentsResourceProvider) |
(...skipping 10 matching lines...) Expand all Loading... |
171 const Extension* extension = GetExtensionForWebContents(web_contents); | 172 const Extension* extension = GetExtensionForWebContents(web_contents); |
172 if (!extension) { | 173 if (!extension) { |
173 NOTREACHED(); | 174 NOTREACHED(); |
174 return scoped_ptr<RendererResource>(); | 175 return scoped_ptr<RendererResource>(); |
175 } | 176 } |
176 return scoped_ptr<RendererResource>(new ExtensionProcessResource( | 177 return scoped_ptr<RendererResource>(new ExtensionProcessResource( |
177 extension, web_contents->GetRenderViewHost())); | 178 extension, web_contents->GetRenderViewHost())); |
178 } | 179 } |
179 | 180 |
180 } // namespace task_manager | 181 } // namespace task_manager |
OLD | NEW |