| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 #include "extensions/browser/extension_system.h" | 75 #include "extensions/browser/extension_system.h" |
| 76 #include "extensions/browser/lazy_background_task_queue.h" | 76 #include "extensions/browser/lazy_background_task_queue.h" |
| 77 #include "extensions/browser/management_policy.h" | 77 #include "extensions/browser/management_policy.h" |
| 78 #include "extensions/browser/pref_names.h" | 78 #include "extensions/browser/pref_names.h" |
| 79 #include "extensions/browser/view_type_utils.h" | 79 #include "extensions/browser/view_type_utils.h" |
| 80 #include "extensions/common/constants.h" | 80 #include "extensions/common/constants.h" |
| 81 #include "extensions/common/extension.h" | 81 #include "extensions/common/extension.h" |
| 82 #include "extensions/common/extension_icon_set.h" | 82 #include "extensions/common/extension_icon_set.h" |
| 83 #include "extensions/common/extension_set.h" | 83 #include "extensions/common/extension_set.h" |
| 84 #include "extensions/common/feature_switch.h" | 84 #include "extensions/common/feature_switch.h" |
| 85 #include "extensions/common/manifest.h" |
| 85 #include "extensions/common/manifest_handlers/background_info.h" | 86 #include "extensions/common/manifest_handlers/background_info.h" |
| 86 #include "extensions/common/manifest_handlers/incognito_info.h" | 87 #include "extensions/common/manifest_handlers/incognito_info.h" |
| 87 #include "grit/browser_resources.h" | 88 #include "grit/browser_resources.h" |
| 88 #include "grit/chromium_strings.h" | 89 #include "grit/chromium_strings.h" |
| 89 #include "grit/generated_resources.h" | 90 #include "grit/generated_resources.h" |
| 90 #include "grit/theme_resources.h" | 91 #include "grit/theme_resources.h" |
| 91 #include "ui/base/l10n/l10n_util.h" | 92 #include "ui/base/l10n/l10n_util.h" |
| 92 #include "ui/base/resource/resource_bundle.h" | 93 #include "ui/base/resource/resource_bundle.h" |
| 93 | 94 |
| 94 using base::DictionaryValue; | 95 using base::DictionaryValue; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 if (!warnings.empty()) { | 328 if (!warnings.empty()) { |
| 328 base::ListValue* warnings_list = new base::ListValue; | 329 base::ListValue* warnings_list = new base::ListValue; |
| 329 for (std::vector<std::string>::const_iterator iter = warnings.begin(); | 330 for (std::vector<std::string>::const_iterator iter = warnings.begin(); |
| 330 iter != warnings.end(); ++iter) { | 331 iter != warnings.end(); ++iter) { |
| 331 warnings_list->Append(base::Value::CreateStringValue(*iter)); | 332 warnings_list->Append(base::Value::CreateStringValue(*iter)); |
| 332 } | 333 } |
| 333 extension_data->Set("warnings", warnings_list); | 334 extension_data->Set("warnings", warnings_list); |
| 334 } | 335 } |
| 335 } | 336 } |
| 336 | 337 |
| 337 // If the ErrorConsole is enabled, get the errors for the extension and add | 338 // If the ErrorConsole is enabled and the extension is unpacked, use the more |
| 338 // them to the list. Otherwise, use the install warnings (using both is | 339 // detailed errors from the ErrorConsole. Otherwise, use the install warnings |
| 339 // redundant). | 340 // (using both is redundant). |
| 340 ErrorConsole* error_console = | 341 ErrorConsole* error_console = |
| 341 ErrorConsole::Get(extension_service_->profile()); | 342 ErrorConsole::Get(extension_service_->profile()); |
| 342 if (error_console->IsEnabledForChromeExtensionsPage()) { | 343 if (error_console->IsEnabledForChromeExtensionsPage() && |
| 344 extension->location() == Manifest::UNPACKED) { |
| 343 const ErrorList& errors = | 345 const ErrorList& errors = |
| 344 error_console->GetErrorsForExtension(extension->id()); | 346 error_console->GetErrorsForExtension(extension->id()); |
| 345 if (!errors.empty()) { | 347 if (!errors.empty()) { |
| 346 scoped_ptr<base::ListValue> manifest_errors(new base::ListValue); | 348 scoped_ptr<base::ListValue> manifest_errors(new base::ListValue); |
| 347 scoped_ptr<base::ListValue> runtime_errors(new base::ListValue); | 349 scoped_ptr<base::ListValue> runtime_errors(new base::ListValue); |
| 348 for (ErrorList::const_iterator iter = errors.begin(); | 350 for (ErrorList::const_iterator iter = errors.begin(); |
| 349 iter != errors.end(); ++iter) { | 351 iter != errors.end(); ++iter) { |
| 350 if ((*iter)->type() == ExtensionError::MANIFEST_ERROR) { | 352 if ((*iter)->type() == ExtensionError::MANIFEST_ERROR) { |
| 351 manifest_errors->Append((*iter)->ToValue().release()); | 353 manifest_errors->Append((*iter)->ToValue().release()); |
| 352 } else { // Handle runtime error. | 354 } else { // Handle runtime error. |
| (...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 const base::FilePath& path) { | 1331 const base::FilePath& path) { |
| 1330 if (IndexOfLoadingPath(path) == -1) | 1332 if (IndexOfLoadingPath(path) == -1) |
| 1331 return; // Not an extension we're tracking. | 1333 return; // Not an extension we're tracking. |
| 1332 if (retry) | 1334 if (retry) |
| 1333 LoadUnpackedExtension(path); | 1335 LoadUnpackedExtension(path); |
| 1334 else | 1336 else |
| 1335 RemoveLoadingPath(path); | 1337 RemoveLoadingPath(path); |
| 1336 } | 1338 } |
| 1337 | 1339 |
| 1338 } // namespace extensions | 1340 } // namespace extensions |
| OLD | NEW |