OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/extensions_service.h" | 5 #include "chrome/browser/extensions/extensions_service.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/thread.h" | 10 #include "base/thread.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 FilePath manifest_path = FilePath::FromWStringHack(child_path).Append( | 79 FilePath manifest_path = FilePath::FromWStringHack(child_path).Append( |
80 Extension::kManifestFilename); | 80 Extension::kManifestFilename); |
81 if (!file_util::PathExists(manifest_path)) { | 81 if (!file_util::PathExists(manifest_path)) { |
82 ReportExtensionLoadError(frontend.get(), | 82 ReportExtensionLoadError(frontend.get(), |
83 Extension::kInvalidManifestError); | 83 Extension::kInvalidManifestError); |
84 continue; | 84 continue; |
85 } | 85 } |
86 | 86 |
87 JSONFileValueSerializer serializer(manifest_path.ToWStringHack()); | 87 JSONFileValueSerializer serializer(manifest_path.ToWStringHack()); |
88 Value* root = NULL; | 88 Value* root = NULL; |
89 if (!serializer.Deserialize(&root)) { | 89 if (!serializer.Deserialize(&root, NULL)) { |
90 ReportExtensionLoadError(frontend.get(), | 90 ReportExtensionLoadError(frontend.get(), |
91 Extension::kInvalidManifestError); | 91 Extension::kInvalidManifestError); |
92 continue; | 92 continue; |
93 } | 93 } |
94 | 94 |
95 if (!root->IsType(Value::TYPE_DICTIONARY)) { | 95 if (!root->IsType(Value::TYPE_DICTIONARY)) { |
96 ReportExtensionLoadError(frontend.get(), | 96 ReportExtensionLoadError(frontend.get(), |
97 Extension::kInvalidManifestError); | 97 Extension::kInvalidManifestError); |
98 continue; | 98 continue; |
99 } | 99 } |
(...skipping 21 matching lines...) Expand all Loading... |
121 error)); | 121 error)); |
122 } | 122 } |
123 | 123 |
124 void ExtensionsServiceBackend::ReportExtensionsLoaded( | 124 void ExtensionsServiceBackend::ReportExtensionsLoaded( |
125 ExtensionsServiceFrontendInterface *frontend, ExtensionList* extensions) { | 125 ExtensionsServiceFrontendInterface *frontend, ExtensionList* extensions) { |
126 frontend->GetMessageLoop()->PostTask(FROM_HERE, NewRunnableMethod( | 126 frontend->GetMessageLoop()->PostTask(FROM_HERE, NewRunnableMethod( |
127 frontend, | 127 frontend, |
128 &ExtensionsServiceFrontendInterface::OnExtensionsLoadedFromDirectory, | 128 &ExtensionsServiceFrontendInterface::OnExtensionsLoadedFromDirectory, |
129 extensions)); | 129 extensions)); |
130 } | 130 } |
OLD | NEW |