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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Determine if a given extension download should be treated as if it came | 101 // Determine if a given extension download should be treated as if it came |
102 // from the gallery. Note that this is requires *both* that the download_url | 102 // from the gallery. Note that this is requires *both* that the download_url |
103 // match and that the download was referred from a gallery page. | 103 // match and that the download was referred from a gallery page. |
104 bool IsDownloadFromGallery(const GURL& download_url, | 104 bool IsDownloadFromGallery(const GURL& download_url, |
105 const GURL& referrer_url); | 105 const GURL& referrer_url); |
106 | 106 |
107 // Determine if the downloaded extension came from the theme mini-gallery, | 107 // Determine if the downloaded extension came from the theme mini-gallery, |
108 // Used to test if we need to show the "Loading" dialog for themes. | 108 // Used to test if we need to show the "Loading" dialog for themes. |
109 static bool IsDownloadFromMiniGallery(const GURL& download_url); | 109 static bool IsDownloadFromMiniGallery(const GURL& download_url); |
110 | 110 |
| 111 // Returns the Extension of hosted or packaged apps, NULL otherwise. |
| 112 const Extension* GetInstalledApp(const GURL& url); |
| 113 |
111 // Returns whether the URL is from either a hosted or packaged app. | 114 // Returns whether the URL is from either a hosted or packaged app. |
112 bool IsInstalledApp(const GURL& url); | 115 bool IsInstalledApp(const GURL& url); |
113 | 116 |
114 // Attempts to uninstall an extension from a given ExtensionService. Returns | 117 // Attempts to uninstall an extension from a given ExtensionService. Returns |
115 // true iff the target extension exists. | 118 // true iff the target extension exists. |
116 static bool UninstallExtensionHelper(ExtensionService* extensions_service, | 119 static bool UninstallExtensionHelper(ExtensionService* extensions_service, |
117 const std::string& extension_id); | 120 const std::string& extension_id); |
118 | 121 |
119 // Constructor stores pointers to |profile| and |extension_prefs| but | 122 // Constructor stores pointers to |profile| and |extension_prefs| but |
120 // ownership remains at caller. | 123 // ownership remains at caller. |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 577 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
575 UpdatePendingExtensionAlreadyInstalled); | 578 UpdatePendingExtensionAlreadyInstalled); |
576 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 579 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
577 InstallAppsWithUnlimtedStorage); | 580 InstallAppsWithUnlimtedStorage); |
578 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 581 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
579 InstallAppsAndCheckStorageProtection); | 582 InstallAppsAndCheckStorageProtection); |
580 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 583 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
581 }; | 584 }; |
582 | 585 |
583 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 586 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |