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/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/common/extensions/api/developer_private.h" | 8 #include "chrome/common/extensions/api/developer_private.h" |
9 #include "content/public/browser/render_frame_host.h" | 9 #include "content/public/browser/render_frame_host.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 break; | 51 break; |
52 case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | 52 case VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
53 view->type = api::developer_private::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; | 53 view->type = api::developer_private::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE; |
54 break; | 54 break; |
55 case VIEW_TYPE_EXTENSION_DIALOG: | 55 case VIEW_TYPE_EXTENSION_DIALOG: |
56 view->type = api::developer_private::VIEW_TYPE_EXTENSION_DIALOG; | 56 view->type = api::developer_private::VIEW_TYPE_EXTENSION_DIALOG; |
57 break; | 57 break; |
58 case VIEW_TYPE_EXTENSION_POPUP: | 58 case VIEW_TYPE_EXTENSION_POPUP: |
59 view->type = api::developer_private::VIEW_TYPE_EXTENSION_POPUP; | 59 view->type = api::developer_private::VIEW_TYPE_EXTENSION_POPUP; |
60 break; | 60 break; |
| 61 case VIEW_TYPE_EXTENSION_SIDEBAR: |
| 62 view->type = api::developer_private::VIEW_TYPE_EXTENSION_SIDEBAR; |
| 63 break; |
61 case VIEW_TYPE_LAUNCHER_PAGE: | 64 case VIEW_TYPE_LAUNCHER_PAGE: |
62 view->type = api::developer_private::VIEW_TYPE_LAUNCHER_PAGE; | 65 view->type = api::developer_private::VIEW_TYPE_LAUNCHER_PAGE; |
63 break; | 66 break; |
64 case VIEW_TYPE_PANEL: | 67 case VIEW_TYPE_PANEL: |
65 view->type = api::developer_private::VIEW_TYPE_PANEL; | 68 view->type = api::developer_private::VIEW_TYPE_PANEL; |
66 break; | 69 break; |
67 case VIEW_TYPE_TAB_CONTENTS: | 70 case VIEW_TYPE_TAB_CONTENTS: |
68 view->type = api::developer_private::VIEW_TYPE_TAB_CONTENTS; | 71 view->type = api::developer_private::VIEW_TYPE_TAB_CONTENTS; |
69 break; | 72 break; |
70 case VIEW_TYPE_VIRTUAL_KEYBOARD: | 73 case VIEW_TYPE_VIRTUAL_KEYBOARD: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 ProcessManager* process_manager, | 130 ProcessManager* process_manager, |
128 bool is_incognito, | 131 bool is_incognito, |
129 ViewList* result) { | 132 ViewList* result) { |
130 const std::set<content::RenderFrameHost*>& hosts = | 133 const std::set<content::RenderFrameHost*>& hosts = |
131 process_manager->GetRenderFrameHostsForExtension(extension.id()); | 134 process_manager->GetRenderFrameHostsForExtension(extension.id()); |
132 for (content::RenderFrameHost* host : hosts) { | 135 for (content::RenderFrameHost* host : hosts) { |
133 content::WebContents* web_contents = | 136 content::WebContents* web_contents = |
134 content::WebContents::FromRenderFrameHost(host); | 137 content::WebContents::FromRenderFrameHost(host); |
135 ViewType host_type = GetViewType(web_contents); | 138 ViewType host_type = GetViewType(web_contents); |
136 if (host_type == VIEW_TYPE_EXTENSION_POPUP || | 139 if (host_type == VIEW_TYPE_EXTENSION_POPUP || |
137 host_type == VIEW_TYPE_EXTENSION_DIALOG) { | 140 host_type == VIEW_TYPE_EXTENSION_DIALOG || |
| 141 host_type == VIEW_TYPE_EXTENSION_SIDEBAR) { |
138 continue; | 142 continue; |
139 } | 143 } |
140 | 144 |
141 GURL url = web_contents->GetURL(); | 145 GURL url = web_contents->GetURL(); |
142 // If this is a background page that just opened, there might not be a | 146 // If this is a background page that just opened, there might not be a |
143 // committed (or visible) url yet. In this case, use the initial url. | 147 // committed (or visible) url yet. In this case, use the initial url. |
144 if (url.is_empty()) { | 148 if (url.is_empty()) { |
145 ExtensionHost* extension_host = | 149 ExtensionHost* extension_host = |
146 process_manager->GetExtensionHostForRenderFrameHost(host); | 150 process_manager->GetExtensionHostForRenderFrameHost(host); |
147 if (extension_host) | 151 if (extension_host) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 | 186 |
183 result->push_back(ConstructView(url, | 187 result->push_back(ConstructView(url, |
184 process->GetID(), | 188 process->GetID(), |
185 web_contents->GetRoutingID(), | 189 web_contents->GetRoutingID(), |
186 false, | 190 false, |
187 GetViewType(web_contents))); | 191 GetViewType(web_contents))); |
188 } | 192 } |
189 } | 193 } |
190 | 194 |
191 } // namespace extensions | 195 } // namespace extensions |
OLD | NEW |