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/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/app_window.h" | 9 #include "apps/app_window.h" |
10 #include "apps/app_window_registry.h" | 10 #include "apps/app_window_registry.h" |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 } | 1366 } |
1367 | 1367 |
1368 ExtensionUninstallDialog* | 1368 ExtensionUninstallDialog* |
1369 ExtensionSettingsHandler::GetExtensionUninstallDialog() { | 1369 ExtensionSettingsHandler::GetExtensionUninstallDialog() { |
1370 #if !defined(OS_ANDROID) | 1370 #if !defined(OS_ANDROID) |
1371 if (!extension_uninstall_dialog_.get()) { | 1371 if (!extension_uninstall_dialog_.get()) { |
1372 Browser* browser = chrome::FindBrowserWithWebContents( | 1372 Browser* browser = chrome::FindBrowserWithWebContents( |
1373 web_ui()->GetWebContents()); | 1373 web_ui()->GetWebContents()); |
1374 extension_uninstall_dialog_.reset( | 1374 extension_uninstall_dialog_.reset( |
1375 ExtensionUninstallDialog::Create(extension_service_->profile(), | 1375 ExtensionUninstallDialog::Create(extension_service_->profile(), |
1376 browser, this)); | 1376 chrome::FindWindowForBrowser(browser), |
| 1377 this)); |
1377 } | 1378 } |
1378 return extension_uninstall_dialog_.get(); | 1379 return extension_uninstall_dialog_.get(); |
1379 #else | 1380 #else |
1380 return NULL; | 1381 return NULL; |
1381 #endif // !defined(OS_ANDROID) | 1382 #endif // !defined(OS_ANDROID) |
1382 } | 1383 } |
1383 | 1384 |
1384 void ExtensionSettingsHandler::OnRequirementsChecked( | 1385 void ExtensionSettingsHandler::OnRequirementsChecked( |
1385 std::string extension_id, | 1386 std::string extension_id, |
1386 std::vector<std::string> requirement_errors) { | 1387 std::vector<std::string> requirement_errors) { |
1387 if (requirement_errors.empty()) { | 1388 if (requirement_errors.empty()) { |
1388 extension_service_->EnableExtension(extension_id); | 1389 extension_service_->EnableExtension(extension_id); |
1389 } else { | 1390 } else { |
1390 ExtensionErrorReporter::GetInstance()->ReportError( | 1391 ExtensionErrorReporter::GetInstance()->ReportError( |
1391 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1392 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
1392 true); // Be noisy. | 1393 true); // Be noisy. |
1393 } | 1394 } |
1394 requirements_checker_.reset(); | 1395 requirements_checker_.reset(); |
1395 } | 1396 } |
1396 | 1397 |
1397 } // namespace extensions | 1398 } // namespace extensions |
OLD | NEW |