OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/developer_private/extension_info_generat
or.h" | 5 #include "chrome/browser/extensions/api/developer_private/extension_info_generat
or.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/api/developer_private/inspectable_views_find
er.h" | 8 #include "chrome/browser/extensions/api/developer_private/inspectable_views_find
er.h" |
9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 9 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
10 #include "chrome/browser/extensions/error_console/error_console.h" | 10 #include "chrome/browser/extensions/error_console/error_console.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Populates the common fields of an extension error. | 72 // Populates the common fields of an extension error. |
73 template <typename ErrorType> | 73 template <typename ErrorType> |
74 void PopulateErrorBase(const ExtensionError& error, ErrorType* out) { | 74 void PopulateErrorBase(const ExtensionError& error, ErrorType* out) { |
75 CHECK(out); | 75 CHECK(out); |
76 out->type = error.type() == ExtensionError::MANIFEST_ERROR ? | 76 out->type = error.type() == ExtensionError::MANIFEST_ERROR ? |
77 developer::ERROR_TYPE_MANIFEST : developer::ERROR_TYPE_RUNTIME; | 77 developer::ERROR_TYPE_MANIFEST : developer::ERROR_TYPE_RUNTIME; |
78 out->extension_id = error.extension_id(); | 78 out->extension_id = error.extension_id(); |
79 out->from_incognito = error.from_incognito(); | 79 out->from_incognito = error.from_incognito(); |
80 out->source = base::UTF16ToUTF8(error.source()); | 80 out->source = base::UTF16ToUTF8(error.source()); |
81 out->message = base::UTF16ToUTF8(error.message()); | 81 out->message = base::UTF16ToUTF8(error.message()); |
| 82 out->id = error.id(); |
82 } | 83 } |
83 | 84 |
84 // Given a ManifestError object, converts it into its developer_private | 85 // Given a ManifestError object, converts it into its developer_private |
85 // counterpart. | 86 // counterpart. |
86 linked_ptr<developer::ManifestError> ConstructManifestError( | 87 linked_ptr<developer::ManifestError> ConstructManifestError( |
87 const ManifestError& error) { | 88 const ManifestError& error) { |
88 linked_ptr<developer::ManifestError> result(new developer::ManifestError()); | 89 linked_ptr<developer::ManifestError> result(new developer::ManifestError()); |
89 PopulateErrorBase(error, result.get()); | 90 PopulateErrorBase(error, result.get()); |
90 result->manifest_key = base::UTF16ToUTF8(error.manifest_key()); | 91 result->manifest_key = base::UTF16ToUTF8(error.manifest_key()); |
91 if (!error.manifest_specific().empty()) { | 92 if (!error.manifest_specific().empty()) { |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 416 } |
416 if (include_terminated) { | 417 if (include_terminated) { |
417 add_to_list(registry->terminated_extensions(), | 418 add_to_list(registry->terminated_extensions(), |
418 developer::EXTENSION_STATE_TERMINATED); | 419 developer::EXTENSION_STATE_TERMINATED); |
419 } | 420 } |
420 | 421 |
421 return list; | 422 return list; |
422 } | 423 } |
423 | 424 |
424 } // namespace extensions | 425 } // namespace extensions |
OLD | NEW |