| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 static const char* kLocalExtensionSettingsDirectoryName; | 151 static const char* kLocalExtensionSettingsDirectoryName; |
| 152 | 152 |
| 153 // The name of the directory inside the profile where per-app synced settings | 153 // The name of the directory inside the profile where per-app synced settings |
| 154 // are stored. | 154 // are stored. |
| 155 static const char* kSyncAppSettingsDirectoryName; | 155 static const char* kSyncAppSettingsDirectoryName; |
| 156 | 156 |
| 157 // The name of the directory inside the profile where per-extension synced | 157 // The name of the directory inside the profile where per-extension synced |
| 158 // settings are stored. | 158 // settings are stored. |
| 159 static const char* kSyncExtensionSettingsDirectoryName; | 159 static const char* kSyncExtensionSettingsDirectoryName; |
| 160 | 160 |
| 161 // Returns true if platform apps should be run in their own user data |
| 162 // directory. |
| 163 static bool PlatformAppRequiresSeparateDataDirectory(); |
| 164 |
| 161 // Determine if a given extension download should be treated as if it came | 165 // Determine if a given extension download should be treated as if it came |
| 162 // from the gallery. Note that this is requires *both* that the download_url | 166 // from the gallery. Note that this is requires *both* that the download_url |
| 163 // match and that the download was referred from a gallery page. | 167 // match and that the download was referred from a gallery page. |
| 164 bool IsDownloadFromGallery(const GURL& download_url, | 168 bool IsDownloadFromGallery(const GURL& download_url, |
| 165 const GURL& referrer_url); | 169 const GURL& referrer_url); |
| 166 | 170 |
| 167 // Returns the Extension of hosted or packaged apps, NULL otherwise. | 171 // Returns the Extension of hosted or packaged apps, NULL otherwise. |
| 168 const Extension* GetInstalledApp(const GURL& url); | 172 const Extension* GetInstalledApp(const GURL& url); |
| 169 | 173 |
| 170 // Returns whether the URL is from either a hosted or packaged app. | 174 // Returns whether the URL is from either a hosted or packaged app. |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 // browser process. | 691 // browser process. |
| 688 void RegisterNaClModule(const GURL& url, const std::string& mime_type); | 692 void RegisterNaClModule(const GURL& url, const std::string& mime_type); |
| 689 void UnregisterNaClModule(const GURL& url); | 693 void UnregisterNaClModule(const GURL& url); |
| 690 | 694 |
| 691 // Call UpdatePluginListWithNaClModules() after registering or unregistering | 695 // Call UpdatePluginListWithNaClModules() after registering or unregistering |
| 692 // a NaCl module to see those changes reflected in the PluginList. | 696 // a NaCl module to see those changes reflected in the PluginList. |
| 693 void UpdatePluginListWithNaClModules(); | 697 void UpdatePluginListWithNaClModules(); |
| 694 | 698 |
| 695 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); | 699 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); |
| 696 | 700 |
| 701 // Sets up preferences for a newly installed extension. |page_ordinal| is |
| 702 // order the extension should show up in the NTP. |initial_enable| is true |
| 703 // if the extension should be enabled. |
| 704 void SetupExtensionPrefs(ExtensionPrefs* prefs, |
| 705 const Extension* extension, |
| 706 bool from_webstore, |
| 707 const StringOrdinal& page_ordinal, |
| 708 bool initial_enable); |
| 709 |
| 710 // Sets up preferences for a newly installed extension in a new data |
| 711 // directory. |page_ordinal| is order the extension should show up in the NTP. |
| 712 void SetupExtensionPrefsInSeparateDataDirectory( |
| 713 const Extension* extension, |
| 714 bool from_webstore, |
| 715 const StringOrdinal& page_ordinal); |
| 716 |
| 697 // The profile this ExtensionService is part of. | 717 // The profile this ExtensionService is part of. |
| 698 Profile* profile_; | 718 Profile* profile_; |
| 699 | 719 |
| 700 // Preferences for the owning profile (weak reference). | 720 // Preferences for the owning profile (weak reference). |
| 701 ExtensionPrefs* extension_prefs_; | 721 ExtensionPrefs* extension_prefs_; |
| 702 | 722 |
| 703 // Settings for the owning profile. | 723 // Settings for the owning profile. |
| 704 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; | 724 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; |
| 705 | 725 |
| 706 // The current list of installed extensions. | 726 // The current list of installed extensions. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 scoped_ptr<ExtensionGlobalError> extension_global_error_; | 856 scoped_ptr<ExtensionGlobalError> extension_global_error_; |
| 837 | 857 |
| 838 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 858 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 839 InstallAppsWithUnlimtedStorage); | 859 InstallAppsWithUnlimtedStorage); |
| 840 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 860 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 841 InstallAppsAndCheckStorageProtection); | 861 InstallAppsAndCheckStorageProtection); |
| 842 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 862 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 843 }; | 863 }; |
| 844 | 864 |
| 845 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 865 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |