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

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

Issue 306044: Refactor implementation of BrowserActions, and add support for (Closed)
Patch Set: Make it work on linux too Created 11 years, 2 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
OLDNEW
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 iter != icon_paths.end(); ++iter) { 235 iter != icon_paths.end(); ++iter) {
236 if (extension->GetResource(*iter).GetFilePath().empty()) { 236 if (extension->GetResource(*iter).GetFilePath().empty()) {
237 *error = StringPrintf("Could not load icon '%s' for page action.", 237 *error = StringPrintf("Could not load icon '%s' for page action.",
238 iter->c_str()); 238 iter->c_str());
239 return false; 239 return false;
240 } 240 }
241 } 241 }
242 } 242 }
243 243
244 // Validate icon location for browser actions. 244 // Validate icon location for browser actions.
245 const ExtensionAction* browser_action = extension->browser_action(); 245 ExtensionAction2* browser_action = extension->browser_action();
246 if (browser_action) { 246 if (browser_action) {
247 const std::vector<std::string>& icon_paths = browser_action->icon_paths(); 247 std::vector<std::string>* icon_paths = browser_action->icon_paths();
248 for (std::vector<std::string>::const_iterator iter = icon_paths.begin(); 248 for (std::vector<std::string>::iterator iter = icon_paths->begin();
249 iter != icon_paths.end(); ++iter) { 249 iter != icon_paths->end(); ++iter) {
250 if (extension->GetResource(*iter).GetFilePath().empty()) { 250 if (extension->GetResource(*iter).GetFilePath().empty()) {
251 *error = StringPrintf("Could not load icon '%s' for browser action.", 251 *error = StringPrintf("Could not load icon '%s' for browser action.",
252 iter->c_str()); 252 iter->c_str());
253 return false; 253 return false;
254 } 254 }
255 } 255 }
256 } 256 }
257 257
258 // Check children of extension root to see if any of them start with _ and is 258 // Check children of extension root to see if any of them start with _ and is
259 // not on the reserved list. 259 // not on the reserved list.
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 "Filenames starting with \"_\" are reserved for use by the system.", 399 "Filenames starting with \"_\" are reserved for use by the system.",
400 filename.c_str()); 400 filename.c_str());
401 return false; 401 return false;
402 } 402 }
403 } 403 }
404 404
405 return true; 405 return true;
406 } 406 }
407 407
408 } // namespace extension_file_util 408 } // namespace extension_file_util
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_browser_actions_api.cc ('k') | chrome/browser/extensions/extensions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698