OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 // Returns true if |extension_id| can be launched without being enabled first. | 68 // Returns true if |extension_id| can be launched without being enabled first. |
69 bool IsAppLaunchableWithoutEnabling(const std::string& extension_id, | 69 bool IsAppLaunchableWithoutEnabling(const std::string& extension_id, |
70 content::BrowserContext* context); | 70 content::BrowserContext* context); |
71 | 71 |
72 // Returns true if |extension_id| is idle and it is safe to perform actions such | 72 // Returns true if |extension_id| is idle and it is safe to perform actions such |
73 // as updating. | 73 // as updating. |
74 bool IsExtensionIdle(const std::string& extension_id, | 74 bool IsExtensionIdle(const std::string& extension_id, |
75 content::BrowserContext* context); | 75 content::BrowserContext* context); |
76 | 76 |
77 // Returns true if |extension_id| is installed permanently and not ephemerally. | |
78 bool IsExtensionInstalledPermanently(const std::string& extension_id, | |
79 content::BrowserContext* context); | |
80 | |
81 // Returns the site of the |extension_id|, given the associated |context|. | 77 // Returns the site of the |extension_id|, given the associated |context|. |
82 // Suitable for use with BrowserContext::GetStoragePartitionForSite(). | 78 // Suitable for use with BrowserContext::GetStoragePartitionForSite(). |
83 GURL GetSiteForExtensionId(const std::string& extension_id, | 79 GURL GetSiteForExtensionId(const std::string& extension_id, |
84 content::BrowserContext* context); | 80 content::BrowserContext* context); |
85 | 81 |
86 // Sets the name, id, and icon resource path of the given extension into the | 82 // Sets the name, id, and icon resource path of the given extension into the |
87 // returned dictionary. | 83 // returned dictionary. |
88 scoped_ptr<base::DictionaryValue> GetExtensionInfo(const Extension* extension); | 84 scoped_ptr<base::DictionaryValue> GetExtensionInfo(const Extension* extension); |
89 | 85 |
90 // Returns true if the extension has isolated storage. | 86 // Returns true if the extension has isolated storage. |
91 bool HasIsolatedStorage(const ExtensionInfo& info); | 87 bool HasIsolatedStorage(const ExtensionInfo& info); |
92 | 88 |
93 // Returns true if the site URL corresponds to an extension or app and has | 89 // Returns true if the site URL corresponds to an extension or app and has |
94 // isolated storage. | 90 // isolated storage. |
95 bool SiteHasIsolatedStorage(const GURL& extension_site_url, | 91 bool SiteHasIsolatedStorage(const GURL& extension_site_url, |
96 content::BrowserContext* context); | 92 content::BrowserContext* context); |
97 | 93 |
98 // Returns the default extension/app icon (for extensions or apps that don't | 94 // Returns the default extension/app icon (for extensions or apps that don't |
99 // have one). | 95 // have one). |
100 const gfx::ImageSkia& GetDefaultExtensionIcon(); | 96 const gfx::ImageSkia& GetDefaultExtensionIcon(); |
101 const gfx::ImageSkia& GetDefaultAppIcon(); | 97 const gfx::ImageSkia& GetDefaultAppIcon(); |
102 | 98 |
103 } // namespace util | 99 } // namespace util |
104 } // namespace extensions | 100 } // namespace extensions |
105 | 101 |
106 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ | 102 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_UTIL_H_ |
OLD | NEW |