| 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 "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
| 8 #include "apps/saved_files_service.h" | 8 #include "apps/saved_files_service.h" |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 view->generated_background_page = generated_background_page; | 556 view->generated_background_page = generated_background_page; |
| 557 return view; | 557 return view; |
| 558 } | 558 } |
| 559 | 559 |
| 560 ItemInspectViewList DeveloperPrivateGetItemsInfoFunction:: | 560 ItemInspectViewList DeveloperPrivateGetItemsInfoFunction:: |
| 561 GetInspectablePagesForExtension( | 561 GetInspectablePagesForExtension( |
| 562 const Extension* extension, | 562 const Extension* extension, |
| 563 bool extension_is_enabled) { | 563 bool extension_is_enabled) { |
| 564 ItemInspectViewList result; | 564 ItemInspectViewList result; |
| 565 // Get the extension process's active views. | 565 // Get the extension process's active views. |
| 566 ProcessManager* process_manager = | 566 ProcessManager* process_manager = ProcessManager::Get(GetProfile()); |
| 567 ExtensionSystem::Get(GetProfile())->process_manager(); | |
| 568 GetInspectablePagesForExtensionProcess( | 567 GetInspectablePagesForExtensionProcess( |
| 569 extension, | 568 extension, |
| 570 process_manager->GetRenderViewHostsForExtension(extension->id()), | 569 process_manager->GetRenderViewHostsForExtension(extension->id()), |
| 571 &result); | 570 &result); |
| 572 | 571 |
| 573 // Get app window views. | 572 // Get app window views. |
| 574 GetAppWindowPagesForExtensionProfile(extension, &result); | 573 GetAppWindowPagesForExtensionProfile(extension, &result); |
| 575 | 574 |
| 576 // Include a link to start the lazy background page, if applicable. | 575 // Include a link to start the lazy background page, if applicable. |
| 577 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 576 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 578 extension_is_enabled && | 577 extension_is_enabled && |
| 579 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 578 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
| 580 result.push_back(constructInspectView( | 579 result.push_back(constructInspectView( |
| 581 BackgroundInfo::GetBackgroundURL(extension), | 580 BackgroundInfo::GetBackgroundURL(extension), |
| 582 -1, | 581 -1, |
| 583 -1, | 582 -1, |
| 584 false, | 583 false, |
| 585 BackgroundInfo::HasGeneratedBackgroundPage(extension))); | 584 BackgroundInfo::HasGeneratedBackgroundPage(extension))); |
| 586 } | 585 } |
| 587 | 586 |
| 588 ExtensionService* service = GetExtensionService(GetProfile()); | 587 ExtensionService* service = GetExtensionService(GetProfile()); |
| 589 // Repeat for the incognito process, if applicable. Don't try to get | 588 // Repeat for the incognito process, if applicable. Don't try to get |
| 590 // app windows for incognito process. | 589 // app windows for incognito process. |
| 591 if (service->profile()->HasOffTheRecordProfile() && | 590 if (service->profile()->HasOffTheRecordProfile() && |
| 592 IncognitoInfo::IsSplitMode(extension)) { | 591 IncognitoInfo::IsSplitMode(extension)) { |
| 593 process_manager = ExtensionSystem::Get( | 592 process_manager = |
| 594 service->profile()->GetOffTheRecordProfile())->process_manager(); | 593 ProcessManager::Get(service->profile()->GetOffTheRecordProfile()); |
| 595 GetInspectablePagesForExtensionProcess( | 594 GetInspectablePagesForExtensionProcess( |
| 596 extension, | 595 extension, |
| 597 process_manager->GetRenderViewHostsForExtension(extension->id()), | 596 process_manager->GetRenderViewHostsForExtension(extension->id()), |
| 598 &result); | 597 &result); |
| 599 | 598 |
| 600 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 599 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 601 extension_is_enabled && | 600 extension_is_enabled && |
| 602 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 601 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
| 603 result.push_back(constructInspectView( | 602 result.push_back(constructInspectView( |
| 604 BackgroundInfo::GetBackgroundURL(extension), | 603 BackgroundInfo::GetBackgroundURL(extension), |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 } | 1402 } |
| 1404 | 1403 |
| 1405 error_ui_util::HandleOpenDevTools(dict); | 1404 error_ui_util::HandleOpenDevTools(dict); |
| 1406 | 1405 |
| 1407 return true; | 1406 return true; |
| 1408 } | 1407 } |
| 1409 | 1408 |
| 1410 } // namespace api | 1409 } // namespace api |
| 1411 | 1410 |
| 1412 } // namespace extensions | 1411 } // namespace extensions |
| OLD | NEW |