OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/extensions/extension_file_util.h" | 5 #include "chrome/common/extensions/extension_file_util.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // error->empty(). For now, be consistent. | 108 // error->empty(). For now, be consistent. |
109 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_UNREADABLE); | 109 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_UNREADABLE); |
110 } else { | 110 } else { |
111 *error = base::StringPrintf("%s %s", | 111 *error = base::StringPrintf("%s %s", |
112 errors::kManifestParseError, | 112 errors::kManifestParseError, |
113 error->c_str()); | 113 error->c_str()); |
114 } | 114 } |
115 return NULL; | 115 return NULL; |
116 } | 116 } |
117 | 117 |
118 if (!root->IsType(Value::TYPE_DICTIONARY)) { | 118 if (!root->IsDictionary()) { |
119 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_INVALID); | 119 *error = l10n_util::GetStringUTF8(IDS_EXTENSION_MANIFEST_INVALID); |
120 return NULL; | 120 return NULL; |
121 } | 121 } |
122 | 122 |
123 DictionaryValue* manifest = static_cast<DictionaryValue*>(root.get()); | 123 DictionaryValue* manifest = static_cast<DictionaryValue*>(root.get()); |
124 if (!extension_l10n_util::LocalizeExtension(extension_path, manifest, error)) | 124 if (!extension_l10n_util::LocalizeExtension(extension_path, manifest, error)) |
125 return NULL; | 125 return NULL; |
126 | 126 |
127 scoped_refptr<Extension> extension(Extension::Create( | 127 scoped_refptr<Extension> extension(Extension::Create( |
128 extension_path, | 128 extension_path, |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 return temp_path; | 614 return temp_path; |
615 | 615 |
616 return FilePath(); | 616 return FilePath(); |
617 } | 617 } |
618 | 618 |
619 void DeleteFile(const FilePath& path, bool recursive) { | 619 void DeleteFile(const FilePath& path, bool recursive) { |
620 file_util::Delete(path, recursive); | 620 file_util::Delete(path, recursive); |
621 } | 621 } |
622 | 622 |
623 } // namespace extension_file_util | 623 } // namespace extension_file_util |
OLD | NEW |