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_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Determine if a given extension download should be treated as if it came | 130 // Determine if a given extension download should be treated as if it came |
131 // from the gallery. Note that this is requires *both* that the download_url | 131 // from the gallery. Note that this is requires *both* that the download_url |
132 // match and that the download was referred from a gallery page. | 132 // match and that the download was referred from a gallery page. |
133 bool IsDownloadFromGallery(const GURL& download_url, | 133 bool IsDownloadFromGallery(const GURL& download_url, |
134 const GURL& referrer_url); | 134 const GURL& referrer_url); |
135 | 135 |
136 // Determine if the downloaded extension came from the theme mini-gallery, | 136 // Determine if the downloaded extension came from the theme mini-gallery, |
137 // Used to test if we need to show the "Loading" dialog for themes. | 137 // Used to test if we need to show the "Loading" dialog for themes. |
138 static bool IsDownloadFromMiniGallery(const GURL& download_url); | 138 static bool IsDownloadFromMiniGallery(const GURL& download_url); |
139 | 139 |
| 140 // Returns the Extension of hosted or packaged apps, NULL otherwise. |
| 141 const Extension* GetInstalledApp(const GURL& url); |
| 142 |
140 // Returns whether the URL is from either a hosted or packaged app. | 143 // Returns whether the URL is from either a hosted or packaged app. |
141 bool IsInstalledApp(const GURL& url); | 144 bool IsInstalledApp(const GURL& url); |
142 | 145 |
143 // Attempts to uninstall an extension from a given ExtensionService. Returns | 146 // Attempts to uninstall an extension from a given ExtensionService. Returns |
144 // true iff the target extension exists. | 147 // true iff the target extension exists. |
145 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 148 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
146 const std::string& extension_id); | 149 const std::string& extension_id); |
147 | 150 |
148 // Constructor stores pointers to |profile| and |extension_prefs| but | 151 // Constructor stores pointers to |profile| and |extension_prefs| but |
149 // ownership remains at caller. | 152 // ownership remains at caller. |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 595 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
593 UpdatePendingExtensionAlreadyInstalled); | 596 UpdatePendingExtensionAlreadyInstalled); |
594 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 597 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
595 InstallAppsWithUnlimtedStorage); | 598 InstallAppsWithUnlimtedStorage); |
596 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 599 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
597 InstallAppsAndCheckStorageProtection); | 600 InstallAppsAndCheckStorageProtection); |
598 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 601 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
599 }; | 602 }; |
600 | 603 |
601 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 604 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |