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