OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 8 #include <algorithm> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 // the appropriate header & footer. | 393 // the appropriate header & footer. |
394 static bool FormatPEMForFileOutput(const std::string& input, | 394 static bool FormatPEMForFileOutput(const std::string& input, |
395 std::string* output, | 395 std::string* output, |
396 bool is_public); | 396 bool is_public); |
397 | 397 |
398 // Given an extension, icon size, and match type, read a valid icon if present | 398 // Given an extension, icon size, and match type, read a valid icon if present |
399 // and decode it into result. In the browser process, this will DCHECK if not | 399 // and decode it into result. In the browser process, this will DCHECK if not |
400 // called on the file thread. To easily load extension images on the UI | 400 // called on the file thread. To easily load extension images on the UI |
401 // thread, see ImageLoadingTracker. | 401 // thread, see ImageLoadingTracker. |
402 static void DecodeIcon(const Extension* extension, | 402 static void DecodeIcon(const Extension* extension, |
403 ExtensionIconSet::Icons icon_size, | 403 int icon_size, |
404 ExtensionIconSet::MatchType match_type, | 404 ExtensionIconSet::MatchType match_type, |
405 scoped_ptr<SkBitmap>* result); | 405 scoped_ptr<SkBitmap>* result); |
406 | 406 |
407 // Given an extension and icon size, read it if present and decode it into | 407 // Given an extension and icon size, read it if present and decode it into |
408 // result. In the browser process, this will DCHECK if not called on the | 408 // result. In the browser process, this will DCHECK if not called on the |
409 // file thread. To easily load extension images on the UI thread, see | 409 // file thread. To easily load extension images on the UI thread, see |
410 // ImageLoadingTracker. | 410 // ImageLoadingTracker. |
411 static void DecodeIcon(const Extension* extension, | 411 static void DecodeIcon(const Extension* extension, |
412 ExtensionIconSet::Icons icon_size, | 412 int icon_size, |
413 scoped_ptr<SkBitmap>* result); | 413 scoped_ptr<SkBitmap>* result); |
414 | 414 |
415 // Given an icon_path and icon size, read it if present and decode it into | 415 // Given an icon_path and icon size, read it if present and decode it into |
416 // result. In the browser process, this will DCHECK if not called on the | 416 // result. In the browser process, this will DCHECK if not called on the |
417 // file thread. To easily load extension images on the UI thread, see | 417 // file thread. To easily load extension images on the UI thread, see |
418 // ImageLoadingTracker. | 418 // ImageLoadingTracker. |
419 static void DecodeIconFromPath(const FilePath& icon_path, | 419 static void DecodeIconFromPath(const FilePath& icon_path, |
420 ExtensionIconSet::Icons icon_size, | 420 int icon_size, |
421 scoped_ptr<SkBitmap>* result); | 421 scoped_ptr<SkBitmap>* result); |
422 | 422 |
423 // Returns the default extension/app icon (for extensions or apps that don't | 423 // Returns the default extension/app icon (for extensions or apps that don't |
424 // have one). | 424 // have one). |
425 static const SkBitmap& GetDefaultIcon(bool is_app); | 425 static const SkBitmap& GetDefaultIcon(bool is_app); |
426 | 426 |
427 // Returns the base extension url for a given |extension_id|. | 427 // Returns the base extension url for a given |extension_id|. |
428 static GURL GetBaseURLFromExtensionId(const std::string& extension_id); | 428 static GURL GetBaseURLFromExtensionId(const std::string& extension_id); |
429 | 429 |
430 // Adds an extension to the scripting whitelist. Used for testing only. | 430 // Adds an extension to the scripting whitelist. Used for testing only. |
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 | 1184 |
1185 UpdatedExtensionPermissionsInfo( | 1185 UpdatedExtensionPermissionsInfo( |
1186 const Extension* extension, | 1186 const Extension* extension, |
1187 const PermissionSet* permissions, | 1187 const PermissionSet* permissions, |
1188 Reason reason); | 1188 Reason reason); |
1189 }; | 1189 }; |
1190 | 1190 |
1191 } // namespace extensions | 1191 } // namespace extensions |
1192 | 1192 |
1193 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ | 1193 #endif // CHROME_COMMON_EXTENSIONS_EXTENSION_H_ |
OLD | NEW |