| 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 <string> | 10 #include <string> |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Determine if a given extension download should be treated as if it came | 132 // Determine if a given extension download should be treated as if it came |
| 133 // from the gallery. Note that this is requires *both* that the download_url | 133 // from the gallery. Note that this is requires *both* that the download_url |
| 134 // match and that the download was referred from a gallery page. | 134 // match and that the download was referred from a gallery page. |
| 135 bool IsDownloadFromGallery(const GURL& download_url, | 135 bool IsDownloadFromGallery(const GURL& download_url, |
| 136 const GURL& referrer_url); | 136 const GURL& referrer_url); |
| 137 | 137 |
| 138 // Determine if the downloaded extension came from the theme mini-gallery, | 138 // Determine if the downloaded extension came from the theme mini-gallery, |
| 139 // Used to test if we need to show the "Loading" dialog for themes. | 139 // Used to test if we need to show the "Loading" dialog for themes. |
| 140 static bool IsDownloadFromMiniGallery(const GURL& download_url); | 140 static bool IsDownloadFromMiniGallery(const GURL& download_url); |
| 141 | 141 |
| 142 // Returns the Extension of hosted or packaged apps, NULL otherwise. |
| 143 const Extension* GetInstalledApp(const GURL& url); |
| 144 |
| 142 // Returns whether the URL is from either a hosted or packaged app. | 145 // Returns whether the URL is from either a hosted or packaged app. |
| 143 bool IsInstalledApp(const GURL& url); | 146 bool IsInstalledApp(const GURL& url); |
| 144 | 147 |
| 145 // Attempts to uninstall an extension from a given ExtensionService. Returns | 148 // Attempts to uninstall an extension from a given ExtensionService. Returns |
| 146 // true iff the target extension exists. | 149 // true iff the target extension exists. |
| 147 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 150 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
| 148 const std::string& extension_id); | 151 const std::string& extension_id); |
| 149 | 152 |
| 150 // Constructor stores pointers to |profile| and |extension_prefs| but | 153 // Constructor stores pointers to |profile| and |extension_prefs| but |
| 151 // ownership remains at caller. | 154 // ownership remains at caller. |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 631 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 629 UpdatePendingExtensionAlreadyInstalled); | 632 UpdatePendingExtensionAlreadyInstalled); |
| 630 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 633 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 631 InstallAppsWithUnlimtedStorage); | 634 InstallAppsWithUnlimtedStorage); |
| 632 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 635 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 633 InstallAppsAndCheckStorageProtection); | 636 InstallAppsAndCheckStorageProtection); |
| 634 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 637 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 635 }; | 638 }; |
| 636 | 639 |
| 637 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 640 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |