Chromium Code Reviews| 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/extensions/api/developer_private/inspectable_views_find er.h" | 5 #include "chrome/browser/extensions/api/developer_private/inspectable_views_find er.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_util.h" | 7 #include "chrome/browser/extensions/extension_util.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/common/extensions/api/developer_private.h" | 9 #include "chrome/common/extensions/api/developer_private.h" |
| 10 #include "content/public/browser/render_frame_host.h" | 10 #include "content/public/browser/render_frame_host.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 break; | 53 break; |
| 54 case VIEW_TYPE_BACKGROUND_CONTENTS: | 54 case VIEW_TYPE_BACKGROUND_CONTENTS: |
| 55 view->type = api::developer_private::VIEW_TYPE_BACKGROUND_CONTENTS; | 55 view->type = api::developer_private::VIEW_TYPE_BACKGROUND_CONTENTS; |
| 56 break; | 56 break; |
| 57 case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | 57 case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
| 58 view->type = api::developer_private::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; | 58 view->type = api::developer_private::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; |
| 59 break; | 59 break; |
| 60 case VIEW_TYPE_EXTENSION_DIALOG: | 60 case VIEW_TYPE_EXTENSION_DIALOG: |
| 61 view->type = api::developer_private::VIEW_TYPE_EXTENSION_DIALOG; | 61 view->type = api::developer_private::VIEW_TYPE_EXTENSION_DIALOG; |
| 62 break; | 62 break; |
| 63 case VIEW_TYPE_EXTENSION_GUEST: | |
| 64 view->type = api::developer_private::VIEW_TYPE_EXTENSION_GUEST; | |
| 65 break; | |
| 63 case VIEW_TYPE_EXTENSION_POPUP: | 66 case VIEW_TYPE_EXTENSION_POPUP: |
| 64 view->type = api::developer_private::VIEW_TYPE_EXTENSION_POPUP; | 67 view->type = api::developer_private::VIEW_TYPE_EXTENSION_POPUP; |
| 65 break; | 68 break; |
| 66 case VIEW_TYPE_LAUNCHER_PAGE: | 69 case VIEW_TYPE_LAUNCHER_PAGE: |
| 67 view->type = api::developer_private::VIEW_TYPE_LAUNCHER_PAGE; | 70 view->type = api::developer_private::VIEW_TYPE_LAUNCHER_PAGE; |
| 68 break; | 71 break; |
| 69 case VIEW_TYPE_PANEL: | 72 case VIEW_TYPE_PANEL: |
| 70 view->type = api::developer_private::VIEW_TYPE_PANEL; | 73 view->type = api::developer_private::VIEW_TYPE_PANEL; |
| 71 break; | 74 break; |
| 72 case VIEW_TYPE_TAB_CONTENTS: | 75 case VIEW_TYPE_TAB_CONTENTS: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 ProcessManager* process_manager, | 145 ProcessManager* process_manager, |
| 143 bool is_incognito, | 146 bool is_incognito, |
| 144 ViewList* result) { | 147 ViewList* result) { |
| 145 const std::set<content::RenderFrameHost*>& hosts = | 148 const std::set<content::RenderFrameHost*>& hosts = |
| 146 process_manager->GetRenderFrameHostsForExtension(extension.id()); | 149 process_manager->GetRenderFrameHostsForExtension(extension.id()); |
| 147 for (content::RenderFrameHost* host : hosts) { | 150 for (content::RenderFrameHost* host : hosts) { |
| 148 content::WebContents* web_contents = | 151 content::WebContents* web_contents = |
| 149 content::WebContents::FromRenderFrameHost(host); | 152 content::WebContents::FromRenderFrameHost(host); |
| 150 ViewType host_type = GetViewType(web_contents); | 153 ViewType host_type = GetViewType(web_contents); |
| 151 if (host_type == VIEW_TYPE_EXTENSION_POPUP || | 154 if (host_type == VIEW_TYPE_EXTENSION_POPUP || |
| 152 host_type == VIEW_TYPE_EXTENSION_DIALOG) { | 155 host_type == VIEW_TYPE_EXTENSION_DIALOG || |
| 156 host_type == VIEW_TYPE_APP_WINDOW) { | |
|
Devlin
2015/12/01 21:40:49
Why don't we want to include APP_WINDOW here? Thi
robwu
2015/12/01 23:19:57
App windows are already dealt with by GetAppWindow
Devlin
2015/12/01 23:29:58
Ah, of course.
| |
| 153 continue; | 157 continue; |
| 154 } | 158 } |
| 155 | 159 |
| 156 GURL url = web_contents->GetURL(); | 160 GURL url = web_contents->GetURL(); |
| 157 // If this is a background page that just opened, there might not be a | 161 // If this is a background page that just opened, there might not be a |
| 158 // committed (or visible) url yet. In this case, use the initial url. | 162 // committed (or visible) url yet. In this case, use the initial url. |
| 159 if (url.is_empty()) { | 163 if (url.is_empty()) { |
| 160 ExtensionHost* extension_host = | 164 ExtensionHost* extension_host = |
| 161 process_manager->GetExtensionHostForRenderFrameHost(host); | 165 process_manager->GetExtensionHostForRenderFrameHost(host); |
| 162 if (extension_host) | 166 if (extension_host) |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 190 url = window->initial_url(); | 194 url = window->initial_url(); |
| 191 | 195 |
| 192 content::RenderProcessHost* process = web_contents->GetRenderProcessHost(); | 196 content::RenderProcessHost* process = web_contents->GetRenderProcessHost(); |
| 193 result->push_back(ConstructView( | 197 result->push_back(ConstructView( |
| 194 url, process->GetID(), web_contents->GetMainFrame()->GetRoutingID(), | 198 url, process->GetID(), web_contents->GetMainFrame()->GetRoutingID(), |
| 195 false, false, GetViewType(web_contents))); | 199 false, false, GetViewType(web_contents))); |
| 196 } | 200 } |
| 197 } | 201 } |
| 198 | 202 |
| 199 } // namespace extensions | 203 } // namespace extensions |
| OLD | NEW |