| 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/common/extensions/extension_unpacker.h" | 5 #include "chrome/common/extensions/extension_unpacker.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/scoped_handle.h" | 8 #include "base/scoped_handle.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/third_party/nss/blapi.h" | 11 #include "base/third_party/nss/blapi.h" |
| 12 #include "base/third_party/nss/sha256.h" | 12 #include "base/third_party/nss/sha256.h" |
| 13 #include "base/thread.h" | 13 #include "base/thread.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "net/base/file_stream.h" | 15 #include "net/base/file_stream.h" |
| 16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
| 17 #include "chrome/common/json_value_serializer.h" | 17 #include "chrome/common/json_value_serializer.h" |
| 18 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
| 19 #include "chrome/common/unzip.h" | |
| 20 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 21 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 22 #include "webkit/glue/image_decoder.h" | 21 #include "webkit/glue/image_decoder.h" |
| 22 #include "chrome/common/zip.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 const char kCurrentVersionFileName[] = "Current Version"; | 25 const char kCurrentVersionFileName[] = "Current Version"; |
| 26 | 26 |
| 27 // The name of a temporary directory to install an extension into for | 27 // The name of a temporary directory to install an extension into for |
| 28 // validation before finalizing install. | 28 // validation before finalizing install. |
| 29 const char kTempExtensionName[] = "TEMP_INSTALL"; | 29 const char kTempExtensionName[] = "TEMP_INSTALL"; |
| 30 | 30 |
| 31 // Chromium Extension magic number | 31 // Chromium Extension magic number |
| 32 const char kExtensionFileMagic[] = "Cr24"; | 32 const char kExtensionFileMagic[] = "Cr24"; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 return false; | 309 return false; |
| 310 } | 310 } |
| 311 | 311 |
| 312 decoded_images_.push_back(MakeTuple(image_bitmap, path)); | 312 decoded_images_.push_back(MakeTuple(image_bitmap, path)); |
| 313 return true; | 313 return true; |
| 314 } | 314 } |
| 315 | 315 |
| 316 void ExtensionUnpacker::SetError(const std::string &error) { | 316 void ExtensionUnpacker::SetError(const std::string &error) { |
| 317 error_message_ = error; | 317 error_message_ = error; |
| 318 } | 318 } |
| OLD | NEW |