| 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/ui/webui/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.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/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/base64.h" | 10 #include "base/base64.h" |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1364 ExtensionManagementFactory::GetForBrowserContext(profile)); | 1364 ExtensionManagementFactory::GetForBrowserContext(profile)); |
| 1365 } | 1365 } |
| 1366 | 1366 |
| 1367 std::vector<ExtensionPage> | 1367 std::vector<ExtensionPage> |
| 1368 ExtensionSettingsHandler::GetInspectablePagesForExtension( | 1368 ExtensionSettingsHandler::GetInspectablePagesForExtension( |
| 1369 const Extension* extension, bool extension_is_enabled) { | 1369 const Extension* extension, bool extension_is_enabled) { |
| 1370 std::vector<ExtensionPage> result; | 1370 std::vector<ExtensionPage> result; |
| 1371 | 1371 |
| 1372 // Get the extension process's active views. | 1372 // Get the extension process's active views. |
| 1373 extensions::ProcessManager* process_manager = | 1373 extensions::ProcessManager* process_manager = |
| 1374 ExtensionSystem::Get(extension_service_->profile())->process_manager(); | 1374 ProcessManager::Get(extension_service_->profile()); |
| 1375 GetInspectablePagesForExtensionProcess( | 1375 GetInspectablePagesForExtensionProcess( |
| 1376 extension, | 1376 extension, |
| 1377 process_manager->GetRenderViewHostsForExtension(extension->id()), | 1377 process_manager->GetRenderViewHostsForExtension(extension->id()), |
| 1378 &result); | 1378 &result); |
| 1379 | 1379 |
| 1380 // Get app window views | 1380 // Get app window views |
| 1381 GetAppWindowPagesForExtensionProfile( | 1381 GetAppWindowPagesForExtensionProfile( |
| 1382 extension, extension_service_->profile(), &result); | 1382 extension, extension_service_->profile(), &result); |
| 1383 | 1383 |
| 1384 // Include a link to start the lazy background page, if applicable. | 1384 // Include a link to start the lazy background page, if applicable. |
| 1385 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 1385 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 1386 extension_is_enabled && | 1386 extension_is_enabled && |
| 1387 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 1387 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
| 1388 result.push_back(ExtensionPage( | 1388 result.push_back(ExtensionPage( |
| 1389 BackgroundInfo::GetBackgroundURL(extension), | 1389 BackgroundInfo::GetBackgroundURL(extension), |
| 1390 -1, | 1390 -1, |
| 1391 -1, | 1391 -1, |
| 1392 false, | 1392 false, |
| 1393 BackgroundInfo::HasGeneratedBackgroundPage(extension))); | 1393 BackgroundInfo::HasGeneratedBackgroundPage(extension))); |
| 1394 } | 1394 } |
| 1395 | 1395 |
| 1396 // Repeat for the incognito process, if applicable. Don't try to get | 1396 // Repeat for the incognito process, if applicable. Don't try to get |
| 1397 // app windows for incognito processes. | 1397 // app windows for incognito processes. |
| 1398 if (extension_service_->profile()->HasOffTheRecordProfile() && | 1398 if (extension_service_->profile()->HasOffTheRecordProfile() && |
| 1399 IncognitoInfo::IsSplitMode(extension) && | 1399 IncognitoInfo::IsSplitMode(extension) && |
| 1400 util::IsIncognitoEnabled(extension->id(), | 1400 util::IsIncognitoEnabled(extension->id(), |
| 1401 extension_service_->profile())) { | 1401 extension_service_->profile())) { |
| 1402 extensions::ProcessManager* process_manager = | 1402 extensions::ProcessManager* process_manager = ProcessManager::Get( |
| 1403 ExtensionSystem::Get(extension_service_->profile()-> | 1403 extension_service_->profile()->GetOffTheRecordProfile()); |
| 1404 GetOffTheRecordProfile())->process_manager(); | |
| 1405 GetInspectablePagesForExtensionProcess( | 1404 GetInspectablePagesForExtensionProcess( |
| 1406 extension, | 1405 extension, |
| 1407 process_manager->GetRenderViewHostsForExtension(extension->id()), | 1406 process_manager->GetRenderViewHostsForExtension(extension->id()), |
| 1408 &result); | 1407 &result); |
| 1409 | 1408 |
| 1410 if (BackgroundInfo::HasLazyBackgroundPage(extension) && | 1409 if (BackgroundInfo::HasLazyBackgroundPage(extension) && |
| 1411 extension_is_enabled && | 1410 extension_is_enabled && |
| 1412 !process_manager->GetBackgroundHostForExtension(extension->id())) { | 1411 !process_manager->GetBackgroundHostForExtension(extension->id())) { |
| 1413 result.push_back(ExtensionPage( | 1412 result.push_back(ExtensionPage( |
| 1414 BackgroundInfo::GetBackgroundURL(extension), | 1413 BackgroundInfo::GetBackgroundURL(extension), |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1512 extension_service_->EnableExtension(extension_id); | 1511 extension_service_->EnableExtension(extension_id); |
| 1513 } else { | 1512 } else { |
| 1514 ExtensionErrorReporter::GetInstance()->ReportError( | 1513 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1515 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1514 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1516 true); // Be noisy. | 1515 true); // Be noisy. |
| 1517 } | 1516 } |
| 1518 requirements_checker_.reset(); | 1517 requirements_checker_.reset(); |
| 1519 } | 1518 } |
| 1520 | 1519 |
| 1521 } // namespace extensions | 1520 } // namespace extensions |
| OLD | NEW |