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

Side by Side Diff: chrome/utility/extensions/unpacker.cc

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/tools/crash_service/main.cc ('k') | chrome_frame/test/dll_redirector_loading_test.cc » ('j') | 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) 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/utility/extensions/unpacker.h" 5 #include "chrome/utility/extensions/unpacker.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_enumerator.h" 10 #include "base/files/file_enumerator.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 return true; 163 return true;
164 } 164 }
165 165
166 bool Unpacker::Run() { 166 bool Unpacker::Run() {
167 DVLOG(1) << "Installing extension " << extension_path_.value(); 167 DVLOG(1) << "Installing extension " << extension_path_.value();
168 168
169 // <profile>/Extensions/CRX_INSTALL 169 // <profile>/Extensions/CRX_INSTALL
170 temp_install_dir_ = 170 temp_install_dir_ =
171 extension_path_.DirName().AppendASCII(kTempExtensionName); 171 extension_path_.DirName().AppendASCII(kTempExtensionName);
172 172
173 if (!file_util::CreateDirectory(temp_install_dir_)) { 173 if (!base::CreateDirectory(temp_install_dir_)) {
174 SetUTF16Error( 174 SetUTF16Error(
175 l10n_util::GetStringFUTF16( 175 l10n_util::GetStringFUTF16(
176 IDS_EXTENSION_PACKAGE_DIRECTORY_ERROR, 176 IDS_EXTENSION_PACKAGE_DIRECTORY_ERROR,
177 base::i18n::GetDisplayStringInLTRDirectionality( 177 base::i18n::GetDisplayStringInLTRDirectionality(
178 temp_install_dir_.LossyDisplayName()))); 178 temp_install_dir_.LossyDisplayName())));
179 return false; 179 return false;
180 } 180 }
181 181
182 if (!zip::Unzip(extension_path_, temp_install_dir_)) { 182 if (!zip::Unzip(extension_path_, temp_install_dir_)) {
183 SetUTF16Error(l10n_util::GetStringUTF16(IDS_EXTENSION_PACKAGE_UNZIP_ERROR)); 183 SetUTF16Error(l10n_util::GetStringUTF16(IDS_EXTENSION_PACKAGE_UNZIP_ERROR));
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 321
322 void Unpacker::SetError(const std::string &error) { 322 void Unpacker::SetError(const std::string &error) {
323 SetUTF16Error(UTF8ToUTF16(error)); 323 SetUTF16Error(UTF8ToUTF16(error));
324 } 324 }
325 325
326 void Unpacker::SetUTF16Error(const string16 &error) { 326 void Unpacker::SetUTF16Error(const string16 &error) {
327 error_message_ = error; 327 error_message_ = error;
328 } 328 }
329 329
330 } // namespace extensions 330 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/tools/crash_service/main.cc ('k') | chrome_frame/test/dll_redirector_loading_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698