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

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

Issue 19052005: Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_creator.h" 5 #include "chrome/browser/extensions/extension_creator.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 bool ExtensionCreator::InitializeInput( 36 bool ExtensionCreator::InitializeInput(
37 const base::FilePath& extension_dir, 37 const base::FilePath& extension_dir,
38 const base::FilePath& crx_path, 38 const base::FilePath& crx_path,
39 const base::FilePath& private_key_path, 39 const base::FilePath& private_key_path,
40 const base::FilePath& private_key_output_path, 40 const base::FilePath& private_key_output_path,
41 int run_flags) { 41 int run_flags) {
42 // Validate input |extension_dir|. 42 // Validate input |extension_dir|.
43 if (extension_dir.value().empty() || 43 if (extension_dir.value().empty() ||
44 !file_util::DirectoryExists(extension_dir)) { 44 !base::DirectoryExists(extension_dir)) {
45 error_message_ = 45 error_message_ =
46 l10n_util::GetStringUTF8(IDS_EXTENSION_DIRECTORY_NO_EXISTS); 46 l10n_util::GetStringUTF8(IDS_EXTENSION_DIRECTORY_NO_EXISTS);
47 return false; 47 return false;
48 } 48 }
49 49
50 base::FilePath absolute_extension_dir = 50 base::FilePath absolute_extension_dir =
51 base::MakeAbsoluteFilePath(extension_dir); 51 base::MakeAbsoluteFilePath(extension_dir);
52 if (absolute_extension_dir.empty()) { 52 if (absolute_extension_dir.empty()) {
53 error_message_ = 53 error_message_ =
54 l10n_util::GetStringUTF8(IDS_EXTENSION_CANT_GET_ABSOLUTE_PATH); 54 l10n_util::GetStringUTF8(IDS_EXTENSION_CANT_GET_ABSOLUTE_PATH);
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 SignZip(zip_path, key_pair.get(), &signature) && 320 SignZip(zip_path, key_pair.get(), &signature) &&
321 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) { 321 WriteCRX(zip_path, key_pair.get(), signature, crx_path)) {
322 result = true; 322 result = true;
323 } 323 }
324 324
325 base::Delete(zip_path, false); 325 base::Delete(zip_path, false);
326 return result; 326 return result;
327 } 327 }
328 328
329 } // namespace extensions 329 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698