OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/extensions/unpacked_installer.h" | 21 #include "chrome/browser/extensions/unpacked_installer.h" |
22 #include "chrome/browser/extensions/updater/extension_updater.h" | 22 #include "chrome/browser/extensions/updater/extension_updater.h" |
23 #include "chrome/browser/platform_util.h" | 23 #include "chrome/browser/platform_util.h" |
24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/ui/chrome_select_file_policy.h" | 25 #include "chrome/browser/ui/chrome_select_file_policy.h" |
26 #include "chrome/browser/ui/extensions/shell_window.h" | 26 #include "chrome/browser/ui/extensions/shell_window.h" |
27 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 27 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
28 #include "chrome/browser/view_type_utils.h" | 28 #include "chrome/browser/view_type_utils.h" |
29 #include "chrome/common/extensions/api/developer_private.h" | 29 #include "chrome/common/extensions/api/developer_private.h" |
30 #include "chrome/common/extensions/api/icons/icons_handler.h" | 30 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 31 #include "chrome/common/extensions/background_info.h" |
31 #include "chrome/common/extensions/extension_icon_set.h" | 32 #include "chrome/common/extensions/extension_icon_set.h" |
32 #include "chrome/common/extensions/extension_resource.h" | 33 #include "chrome/common/extensions/extension_resource.h" |
33 #include "chrome/common/extensions/manifest_url_handler.h" | 34 #include "chrome/common/extensions/manifest_url_handler.h" |
34 #include "content/public/browser/browser_thread.h" | 35 #include "content/public/browser/browser_thread.h" |
35 #include "content/public/browser/render_process_host.h" | 36 #include "content/public/browser/render_process_host.h" |
36 #include "content/public/browser/render_view_host.h" | 37 #include "content/public/browser/render_view_host.h" |
37 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
38 #include "extensions/common/constants.h" | 39 #include "extensions/common/constants.h" |
39 #include "grit/chromium_strings.h" | 40 #include "grit/chromium_strings.h" |
40 #include "grit/generated_resources.h" | 41 #include "grit/generated_resources.h" |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 ExtensionProcessManager* process_manager = | 296 ExtensionProcessManager* process_manager = |
296 ExtensionSystem::Get(profile())->process_manager(); | 297 ExtensionSystem::Get(profile())->process_manager(); |
297 GetInspectablePagesForExtensionProcess( | 298 GetInspectablePagesForExtensionProcess( |
298 process_manager->GetRenderViewHostsForExtension(extension->id()), | 299 process_manager->GetRenderViewHostsForExtension(extension->id()), |
299 &result); | 300 &result); |
300 | 301 |
301 // Get shell window views | 302 // Get shell window views |
302 GetShellWindowPagesForExtensionProfile(extension, &result); | 303 GetShellWindowPagesForExtensionProfile(extension, &result); |
303 | 304 |
304 // Include a link to start the lazy background page, if applicable. | 305 // Include a link to start the lazy background page, if applicable. |
305 if (extension->has_lazy_background_page() && extension_is_enabled && | 306 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 307 extension_is_enabled && |
306 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 308 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
307 result.push_back( | 309 result.push_back(constructInspectView( |
308 constructInspectView(extension->GetBackgroundURL(), -1, -1, false)); | 310 BackgroundInfo::GetBackgroundURL(extension), -1, -1, false)); |
309 } | 311 } |
310 | 312 |
311 ExtensionService* service = profile()->GetExtensionService(); | 313 ExtensionService* service = profile()->GetExtensionService(); |
312 // Repeat for the incognito process, if applicable. Don't try to get | 314 // Repeat for the incognito process, if applicable. Don't try to get |
313 // shell windows for incognito process. | 315 // shell windows for incognito process. |
314 if (service->profile()->HasOffTheRecordProfile() && | 316 if (service->profile()->HasOffTheRecordProfile() && |
315 extension->incognito_split_mode()) { | 317 extension->incognito_split_mode()) { |
316 process_manager = ExtensionSystem::Get( | 318 process_manager = ExtensionSystem::Get( |
317 service->profile()->GetOffTheRecordProfile())->process_manager(); | 319 service->profile()->GetOffTheRecordProfile())->process_manager(); |
318 GetInspectablePagesForExtensionProcess( | 320 GetInspectablePagesForExtensionProcess( |
319 process_manager->GetRenderViewHostsForExtension(extension->id()), | 321 process_manager->GetRenderViewHostsForExtension(extension->id()), |
320 &result); | 322 &result); |
321 | 323 |
322 if (extension->has_lazy_background_page() && extension_is_enabled && | 324 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 325 extension_is_enabled && |
323 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 326 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
324 result.push_back( | 327 result.push_back(constructInspectView( |
325 constructInspectView(extension->GetBackgroundURL(), -1, -1, false)); | 328 BackgroundInfo::GetBackgroundURL(extension), -1, -1, false)); |
326 } | 329 } |
327 } | 330 } |
328 | 331 |
329 return result; | 332 return result; |
330 } | 333 } |
331 | 334 |
332 bool DeveloperPrivateGetItemsInfoFunction::RunImpl() { | 335 bool DeveloperPrivateGetItemsInfoFunction::RunImpl() { |
333 scoped_ptr<developer::GetItemsInfo::Params> params( | 336 scoped_ptr<developer::GetItemsInfo::Params> params( |
334 developer::GetItemsInfo::Params::Create(*args_)); | 337 developer::GetItemsInfo::Params::Create(*args_)); |
335 EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); | 338 EXTENSION_FUNCTION_VALIDATE(params.get() != NULL); |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 | 841 |
839 #undef SET_STRING | 842 #undef SET_STRING |
840 return true; | 843 return true; |
841 } | 844 } |
842 | 845 |
843 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} | 846 DeveloperPrivateGetStringsFunction::~DeveloperPrivateGetStringsFunction() {} |
844 | 847 |
845 } // namespace api | 848 } // namespace api |
846 | 849 |
847 } // namespace extensions | 850 } // namespace extensions |
OLD | NEW |