| 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 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 ExtensionPage(web_contents->GetURL(), | 1476 ExtensionPage(web_contents->GetURL(), |
| 1477 process->GetID(), | 1477 process->GetID(), |
| 1478 host->GetRoutingID(), | 1478 host->GetRoutingID(), |
| 1479 process->GetBrowserContext()->IsOffTheRecord(), | 1479 process->GetBrowserContext()->IsOffTheRecord(), |
| 1480 is_background_page && has_generated_background_page)); | 1480 is_background_page && has_generated_background_page)); |
| 1481 } | 1481 } |
| 1482 } | 1482 } |
| 1483 | 1483 |
| 1484 ExtensionUninstallDialog* | 1484 ExtensionUninstallDialog* |
| 1485 ExtensionSettingsHandler::GetExtensionUninstallDialog() { | 1485 ExtensionSettingsHandler::GetExtensionUninstallDialog() { |
| 1486 #if !defined(OS_ANDROID) | |
| 1487 if (!extension_uninstall_dialog_.get()) { | 1486 if (!extension_uninstall_dialog_.get()) { |
| 1488 Browser* browser = chrome::FindBrowserWithWebContents( | 1487 Browser* browser = chrome::FindBrowserWithWebContents( |
| 1489 web_ui()->GetWebContents()); | 1488 web_ui()->GetWebContents()); |
| 1490 extension_uninstall_dialog_.reset( | 1489 extension_uninstall_dialog_.reset( |
| 1491 ExtensionUninstallDialog::Create(extension_service_->profile(), | 1490 ExtensionUninstallDialog::Create(extension_service_->profile(), |
| 1492 browser->window()->GetNativeWindow(), | 1491 browser->window()->GetNativeWindow(), |
| 1493 this)); | 1492 this)); |
| 1494 } | 1493 } |
| 1495 return extension_uninstall_dialog_.get(); | 1494 return extension_uninstall_dialog_.get(); |
| 1496 #else | |
| 1497 return NULL; | |
| 1498 #endif // !defined(OS_ANDROID) | |
| 1499 } | 1495 } |
| 1500 | 1496 |
| 1501 void ExtensionSettingsHandler::OnReinstallComplete( | 1497 void ExtensionSettingsHandler::OnReinstallComplete( |
| 1502 bool success, | 1498 bool success, |
| 1503 const std::string& error, | 1499 const std::string& error, |
| 1504 webstore_install::Result result) { | 1500 webstore_install::Result result) { |
| 1505 MaybeUpdateAfterNotification(); | 1501 MaybeUpdateAfterNotification(); |
| 1506 } | 1502 } |
| 1507 | 1503 |
| 1508 void ExtensionSettingsHandler::OnRequirementsChecked( | 1504 void ExtensionSettingsHandler::OnRequirementsChecked( |
| 1509 std::string extension_id, | 1505 std::string extension_id, |
| 1510 std::vector<std::string> requirement_errors) { | 1506 std::vector<std::string> requirement_errors) { |
| 1511 if (requirement_errors.empty()) { | 1507 if (requirement_errors.empty()) { |
| 1512 extension_service_->EnableExtension(extension_id); | 1508 extension_service_->EnableExtension(extension_id); |
| 1513 } else { | 1509 } else { |
| 1514 ExtensionErrorReporter::GetInstance()->ReportError( | 1510 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1515 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1511 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1516 true); // Be noisy. | 1512 true); // Be noisy. |
| 1517 } | 1513 } |
| 1518 requirements_checker_.reset(); | 1514 requirements_checker_.reset(); |
| 1519 } | 1515 } |
| 1520 | 1516 |
| 1521 } // namespace extensions | 1517 } // namespace extensions |
| OLD | NEW |