Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: chrome/common/extensions/extension_file_util.cc

Issue 7585003: Fix to make Chromium more verbose about component extension loading error (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed a call for ValidateExtension Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension_file_util.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 error)); 132 error));
133 if (!extension.get()) 133 if (!extension.get())
134 return NULL; 134 return NULL;
135 135
136 if (!ValidateExtension(extension.get(), error)) 136 if (!ValidateExtension(extension.get(), error))
137 return NULL; 137 return NULL;
138 138
139 return extension; 139 return extension;
140 } 140 }
141 141
142 bool ValidateExtension(Extension* extension, std::string* error) { 142 bool ValidateExtension(const Extension* extension, std::string* error) {
143 // Validate icons exist. 143 // Validate icons exist.
144 for (ExtensionIconSet::IconMap::const_iterator iter = 144 for (ExtensionIconSet::IconMap::const_iterator iter =
145 extension->icons().map().begin(); 145 extension->icons().map().begin();
146 iter != extension->icons().map().end(); 146 iter != extension->icons().map().end();
147 ++iter) { 147 ++iter) {
148 const FilePath path = extension->GetResource(iter->second).GetFilePath(); 148 const FilePath path = extension->GetResource(iter->second).GetFilePath();
149 if (!file_util::PathExists(path)) { 149 if (!file_util::PathExists(path)) {
150 *error = 150 *error =
151 l10n_util::GetStringFUTF8(IDS_EXTENSION_LOAD_ICON_FAILED, 151 l10n_util::GetStringFUTF8(IDS_EXTENSION_LOAD_ICON_FAILED,
152 UTF8ToUTF16(iter->second)); 152 UTF8ToUTF16(iter->second));
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_file_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698