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 #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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // Expects base64 encoded |input| and formats into |output| including | 171 // Expects base64 encoded |input| and formats into |output| including |
172 // the appropriate header & footer. | 172 // the appropriate header & footer. |
173 static bool FormatPEMForFileOutput(const std::string input, | 173 static bool FormatPEMForFileOutput(const std::string input, |
174 std::string* output, bool is_public); | 174 std::string* output, bool is_public); |
175 | 175 |
176 // Determine whether |new_extension| has increased privileges compared to | 176 // Determine whether |new_extension| has increased privileges compared to |
177 // |old_extension|. | 177 // |old_extension|. |
178 static bool IsPrivilegeIncrease(Extension* old_extension, | 178 static bool IsPrivilegeIncrease(Extension* old_extension, |
179 Extension* new_extension); | 179 Extension* new_extension); |
180 | 180 |
| 181 // Given an extension and icon size, read it if present and decode it into |
| 182 // result. |
| 183 static void DecodeIcon(Extension* extension, |
| 184 Icons icon_size, |
| 185 scoped_ptr<SkBitmap>* result); |
| 186 |
| 187 // Given an icon_path and icon size, read it if present and decode it into |
| 188 // result. |
| 189 static void DecodeIconFromPath(const FilePath& icon_path, |
| 190 Icons icon_size, |
| 191 scoped_ptr<SkBitmap>* result); |
| 192 |
181 // Initialize the extension from a parsed manifest. | 193 // Initialize the extension from a parsed manifest. |
182 // If |require_id| is true, will return an error if the "id" key is missing | 194 // If |require_id| is true, will return an error if the "id" key is missing |
183 // from the value. | 195 // from the value. |
184 bool InitFromValue(const DictionaryValue& value, bool require_id, | 196 bool InitFromValue(const DictionaryValue& value, bool require_id, |
185 std::string* error); | 197 std::string* error); |
186 | 198 |
187 const FilePath& path() const { return path_; } | 199 const FilePath& path() const { return path_; } |
188 void set_path(const FilePath& path) { path_ = path; } | 200 void set_path(const FilePath& path) { path_ = path; } |
189 const GURL& url() const { return extension_url_; } | 201 const GURL& url() const { return extension_url_; } |
190 const Location location() const { return location_; } | 202 const Location location() const { return location_; } |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 bool background_page_ready_; | 431 bool background_page_ready_; |
420 | 432 |
421 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); | 433 FRIEND_TEST(ExtensionTest, LoadPageActionHelper); |
422 | 434 |
423 DISALLOW_COPY_AND_ASSIGN(Extension); | 435 DISALLOW_COPY_AND_ASSIGN(Extension); |
424 }; | 436 }; |
425 | 437 |
426 typedef std::vector<Extension*> ExtensionList; | 438 typedef std::vector<Extension*> ExtensionList; |
427 | 439 |
428 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 440 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |