OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 10 #include <set> |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Determine if a given extension download should be treated as if it came | 134 // Determine if a given extension download should be treated as if it came |
135 // from the gallery. Note that this is requires *both* that the download_url | 135 // from the gallery. Note that this is requires *both* that the download_url |
136 // match and that the download was referred from a gallery page. | 136 // match and that the download was referred from a gallery page. |
137 bool IsDownloadFromGallery(const GURL& download_url, | 137 bool IsDownloadFromGallery(const GURL& download_url, |
138 const GURL& referrer_url); | 138 const GURL& referrer_url); |
139 | 139 |
140 // Determine if the downloaded extension came from the theme mini-gallery, | 140 // Determine if the downloaded extension came from the theme mini-gallery, |
141 // Used to test if we need to show the "Loading" dialog for themes. | 141 // Used to test if we need to show the "Loading" dialog for themes. |
142 static bool IsDownloadFromMiniGallery(const GURL& download_url); | 142 static bool IsDownloadFromMiniGallery(const GURL& download_url); |
143 | 143 |
| 144 // Returns the Extension of hosted or packaged apps, NULL otherwise. |
| 145 const Extension* GetInstalledApp(const GURL& url); |
| 146 |
144 // Returns whether the URL is from either a hosted or packaged app. | 147 // Returns whether the URL is from either a hosted or packaged app. |
145 bool IsInstalledApp(const GURL& url); | 148 bool IsInstalledApp(const GURL& url); |
146 | 149 |
147 // Attempts to uninstall an extension from a given ExtensionService. Returns | 150 // Attempts to uninstall an extension from a given ExtensionService. Returns |
148 // true iff the target extension exists. | 151 // true iff the target extension exists. |
149 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 152 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
150 const std::string& extension_id); | 153 const std::string& extension_id); |
151 | 154 |
152 // Constructor stores pointers to |profile| and |extension_prefs| but | 155 // Constructor stores pointers to |profile| and |extension_prefs| but |
153 // ownership remains at caller. | 156 // ownership remains at caller. |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 618 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
616 UpdatePendingExtensionAlreadyInstalled); | 619 UpdatePendingExtensionAlreadyInstalled); |
617 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 620 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
618 InstallAppsWithUnlimtedStorage); | 621 InstallAppsWithUnlimtedStorage); |
619 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 622 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
620 InstallAppsAndCheckStorageProtection); | 623 InstallAppsAndCheckStorageProtection); |
621 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 624 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
622 }; | 625 }; |
623 | 626 |
624 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 627 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |