OLD | NEW |
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_unpacker.h" | 5 #include "chrome/common/extensions/extension_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/json/json_value_serializer.h" | 10 #include "base/json/json_value_serializer.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 locale_path.Append(Extension::kMessagesFilename); | 137 locale_path.Append(Extension::kMessagesFilename); |
138 | 138 |
139 if (!ReadMessageCatalog(messages_path)) | 139 if (!ReadMessageCatalog(messages_path)) |
140 return false; | 140 return false; |
141 } | 141 } |
142 | 142 |
143 return true; | 143 return true; |
144 } | 144 } |
145 | 145 |
146 bool ExtensionUnpacker::Run() { | 146 bool ExtensionUnpacker::Run() { |
147 VLOG(1) << "Installing extension " << extension_path_.value(); | 147 DVLOG(1) << "Installing extension " << extension_path_.value(); |
148 | 148 |
149 // <profile>/Extensions/INSTALL_TEMP/<version> | 149 // <profile>/Extensions/INSTALL_TEMP/<version> |
150 temp_install_dir_ = | 150 temp_install_dir_ = |
151 extension_path_.DirName().AppendASCII(filenames::kTempExtensionName); | 151 extension_path_.DirName().AppendASCII(filenames::kTempExtensionName); |
152 | 152 |
153 if (!file_util::CreateDirectory(temp_install_dir_)) { | 153 if (!file_util::CreateDirectory(temp_install_dir_)) { |
154 #if defined(OS_WIN) | 154 #if defined(OS_WIN) |
155 std::string dir_string = WideToUTF8(temp_install_dir_.value()); | 155 std::string dir_string = WideToUTF8(temp_install_dir_.value()); |
156 #else | 156 #else |
157 std::string dir_string = temp_install_dir_.value(); | 157 std::string dir_string = temp_install_dir_.value(); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 return false; | 316 return false; |
317 } | 317 } |
318 parsed_catalogs_->Set(dir_name, root.release()); | 318 parsed_catalogs_->Set(dir_name, root.release()); |
319 | 319 |
320 return true; | 320 return true; |
321 } | 321 } |
322 | 322 |
323 void ExtensionUnpacker::SetError(const std::string &error) { | 323 void ExtensionUnpacker::SetError(const std::string &error) { |
324 error_message_ = error; | 324 error_message_ = error; |
325 } | 325 } |
OLD | NEW |