OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/extension_file_util.h" | 5 #include "chrome/browser/extensions/extension_file_util.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 const Extension::PrivacyBlacklistInfo& blacklist = | 219 const Extension::PrivacyBlacklistInfo& blacklist = |
220 extension->privacy_blacklists()[i]; | 220 extension->privacy_blacklists()[i]; |
221 if (!file_util::PathExists(blacklist.path)) { | 221 if (!file_util::PathExists(blacklist.path)) { |
222 *error = StringPrintf("Could not load '%s' for privacy blacklist.", | 222 *error = StringPrintf("Could not load '%s' for privacy blacklist.", |
223 WideToUTF8(blacklist.path.ToWStringHack()).c_str()); | 223 WideToUTF8(blacklist.path.ToWStringHack()).c_str()); |
224 return false; | 224 return false; |
225 } | 225 } |
226 } | 226 } |
227 | 227 |
228 // Validate icon location for page actions. | 228 // Validate icon location for page actions. |
229 const ExtensionActionMap& page_actions = extension->page_actions(); | 229 const ExtensionAction* page_action = extension->page_action(); |
230 for (ExtensionActionMap::const_iterator i(page_actions.begin()); | 230 if (page_action) { |
231 i != page_actions.end(); ++i) { | |
232 ExtensionAction* page_action = i->second; | |
233 const std::vector<std::string>& icon_paths = page_action->icon_paths(); | 231 const std::vector<std::string>& icon_paths = page_action->icon_paths(); |
234 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); | 232 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); |
235 iter != icon_paths.end(); ++iter) { | 233 iter != icon_paths.end(); ++iter) { |
236 if (extension->GetResource(*iter).GetFilePath().empty()) { | 234 if (extension->GetResource(*iter).GetFilePath().empty()) { |
237 *error = StringPrintf("Could not load icon '%s' for page action.", | 235 *error = StringPrintf("Could not load icon '%s' for page action.", |
238 iter->c_str()); | 236 iter->c_str()); |
239 return false; | 237 return false; |
240 } | 238 } |
241 } | 239 } |
242 } | 240 } |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 "Filenames starting with \"_\" are reserved for use by the system.", | 396 "Filenames starting with \"_\" are reserved for use by the system.", |
399 filename.c_str()); | 397 filename.c_str()); |
400 return false; | 398 return false; |
401 } | 399 } |
402 } | 400 } |
403 | 401 |
404 return true; | 402 return true; |
405 } | 403 } |
406 | 404 |
407 } // extension_file_util | 405 } // extension_file_util |
OLD | NEW |