| 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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 | 354 |
| 355 // Add warnings. | 355 // Add warnings. |
| 356 if (warning_service) { | 356 if (warning_service) { |
| 357 std::vector<std::string> warnings = | 357 std::vector<std::string> warnings = |
| 358 warning_service->GetWarningMessagesForExtension(extension->id()); | 358 warning_service->GetWarningMessagesForExtension(extension->id()); |
| 359 | 359 |
| 360 if (!warnings.empty()) { | 360 if (!warnings.empty()) { |
| 361 base::ListValue* warnings_list = new base::ListValue; | 361 base::ListValue* warnings_list = new base::ListValue; |
| 362 for (std::vector<std::string>::const_iterator iter = warnings.begin(); | 362 for (std::vector<std::string>::const_iterator iter = warnings.begin(); |
| 363 iter != warnings.end(); ++iter) { | 363 iter != warnings.end(); ++iter) { |
| 364 warnings_list->Append(base::Value::CreateStringValue(*iter)); | 364 warnings_list->Append(new base::StringValue(*iter)); |
| 365 } | 365 } |
| 366 extension_data->Set("warnings", warnings_list); | 366 extension_data->Set("warnings", warnings_list); |
| 367 } | 367 } |
| 368 } | 368 } |
| 369 | 369 |
| 370 // If the ErrorConsole is enabled and the extension is unpacked, use the more | 370 // If the ErrorConsole is enabled and the extension is unpacked, use the more |
| 371 // detailed errors from the ErrorConsole. Otherwise, use the install warnings | 371 // detailed errors from the ErrorConsole. Otherwise, use the install warnings |
| 372 // (using both is redundant). | 372 // (using both is redundant). |
| 373 ErrorConsole* error_console = | 373 ErrorConsole* error_console = |
| 374 ErrorConsole::Get(extension_service_->profile()); | 374 ErrorConsole::Get(extension_service_->profile()); |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1156 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); | 1156 ExtensionRegistry* registry = ExtensionRegistry::Get(profile); |
| 1157 const Extension* extension = registry->GetExtensionById( | 1157 const Extension* extension = registry->GetExtensionById( |
| 1158 extension_id, | 1158 extension_id, |
| 1159 ExtensionRegistry::EVERYTHING); | 1159 ExtensionRegistry::EVERYTHING); |
| 1160 CHECK(extension); | 1160 CHECK(extension); |
| 1161 platform_util::OpenItem(profile, extension->path()); | 1161 platform_util::OpenItem(profile, extension->path()); |
| 1162 } | 1162 } |
| 1163 | 1163 |
| 1164 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { | 1164 void ExtensionSettingsHandler::ShowAlert(const std::string& message) { |
| 1165 base::ListValue arguments; | 1165 base::ListValue arguments; |
| 1166 arguments.Append(base::Value::CreateStringValue(message)); | 1166 arguments.Append(new base::StringValue(message)); |
| 1167 web_ui()->CallJavascriptFunction("alert", arguments); | 1167 web_ui()->CallJavascriptFunction("alert", arguments); |
| 1168 } | 1168 } |
| 1169 | 1169 |
| 1170 const Extension* ExtensionSettingsHandler::GetActiveExtension( | 1170 const Extension* ExtensionSettingsHandler::GetActiveExtension( |
| 1171 const base::ListValue* args) { | 1171 const base::ListValue* args) { |
| 1172 std::string extension_id = base::UTF16ToUTF8(ExtractStringValue(args)); | 1172 std::string extension_id = base::UTF16ToUTF8(ExtractStringValue(args)); |
| 1173 CHECK(!extension_id.empty()); | 1173 CHECK(!extension_id.empty()); |
| 1174 return extension_service_->GetExtensionById(extension_id, false); | 1174 return extension_service_->GetExtensionById(extension_id, false); |
| 1175 } | 1175 } |
| 1176 | 1176 |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 extension_service_->EnableExtension(extension_id); | 1367 extension_service_->EnableExtension(extension_id); |
| 1368 } else { | 1368 } else { |
| 1369 ExtensionErrorReporter::GetInstance()->ReportError( | 1369 ExtensionErrorReporter::GetInstance()->ReportError( |
| 1370 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), | 1370 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), |
| 1371 true); // Be noisy. | 1371 true); // Be noisy. |
| 1372 } | 1372 } |
| 1373 requirements_checker_.reset(); | 1373 requirements_checker_.reset(); |
| 1374 } | 1374 } |
| 1375 | 1375 |
| 1376 } // namespace extensions | 1376 } // namespace extensions |
| OLD | NEW |