| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 5 #ifndef CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 6 #define CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 // Expects base64 encoded |input| and formats into |output| including | 178 // Expects base64 encoded |input| and formats into |output| including |
| 179 // the appropriate header & footer. | 179 // the appropriate header & footer. |
| 180 static bool FormatPEMForFileOutput(const std::string input, | 180 static bool FormatPEMForFileOutput(const std::string input, |
| 181 std::string* output, bool is_public); | 181 std::string* output, bool is_public); |
| 182 | 182 |
| 183 // Determine whether |new_extension| has increased privileges compared to | 183 // Determine whether |new_extension| has increased privileges compared to |
| 184 // |old_extension|. | 184 // |old_extension|. |
| 185 static bool IsPrivilegeIncrease(Extension* old_extension, | 185 static bool IsPrivilegeIncrease(Extension* old_extension, |
| 186 Extension* new_extension); | 186 Extension* new_extension); |
| 187 | 187 |
| 188 // *** HITS THE FILESYSTEM. Do not call on UI thread! *** |
| 188 // Given an extension and icon size, read it if present and decode it into | 189 // Given an extension and icon size, read it if present and decode it into |
| 189 // result. | 190 // result. |
| 191 // NOTE: If you need the icon on the UI thread, please use the |
| 192 // ImageLoadingTracker, which uses the File thread to decode. |
| 190 static void DecodeIcon(Extension* extension, | 193 static void DecodeIcon(Extension* extension, |
| 191 Icons icon_size, | 194 Icons icon_size, |
| 192 scoped_ptr<SkBitmap>* result); | 195 scoped_ptr<SkBitmap>* result); |
| 193 | 196 |
| 197 // *** HITS THE FILESYSTEM. Do not call on UI thread! *** |
| 194 // Given an icon_path and icon size, read it if present and decode it into | 198 // Given an icon_path and icon size, read it if present and decode it into |
| 195 // result. | 199 // result. |
| 200 // NOTE: If you need the icon on the UI thread, please use the |
| 201 // ImageLoadingTracker, which uses the File thread to decode. |
| 196 static void DecodeIconFromPath(const FilePath& icon_path, | 202 static void DecodeIconFromPath(const FilePath& icon_path, |
| 197 Icons icon_size, | 203 Icons icon_size, |
| 198 scoped_ptr<SkBitmap>* result); | 204 scoped_ptr<SkBitmap>* result); |
| 199 | 205 |
| 200 // Initialize the extension from a parsed manifest. | 206 // Initialize the extension from a parsed manifest. |
| 201 // Usually, the id of an extension is generated by the "key" property of | 207 // Usually, the id of an extension is generated by the "key" property of |
| 202 // its manifest, but if |require_key| is |false|, a temporary ID will be | 208 // its manifest, but if |require_key| is |false|, a temporary ID will be |
| 203 // generated based on the path. | 209 // generated based on the path. |
| 204 bool InitFromValue(const DictionaryValue& value, bool require_key, | 210 bool InitFromValue(const DictionaryValue& value, bool require_key, |
| 205 std::string* error); | 211 std::string* error); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 scoped_ptr<DictionaryValue> extension_manifest; | 512 scoped_ptr<DictionaryValue> extension_manifest; |
| 507 std::string extension_id; | 513 std::string extension_id; |
| 508 FilePath extension_path; | 514 FilePath extension_path; |
| 509 Extension::Location extension_location; | 515 Extension::Location extension_location; |
| 510 | 516 |
| 511 private: | 517 private: |
| 512 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); | 518 DISALLOW_COPY_AND_ASSIGN(ExtensionInfo); |
| 513 }; | 519 }; |
| 514 | 520 |
| 515 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 521 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
| OLD | NEW |