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 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
579 // extensions. | 579 // extensions. |
580 void IdentifyAlertableExtensions(); | 580 void IdentifyAlertableExtensions(); |
581 | 581 |
582 // Given an ExtensionErrorUI alert, populates it with any extensions that | 582 // Given an ExtensionErrorUI alert, populates it with any extensions that |
583 // need alerting. Returns true if the alert should be displayed at all. | 583 // need alerting. Returns true if the alert should be displayed at all. |
584 // | 584 // |
585 // This method takes the extension_error_ui argument rather than using | 585 // This method takes the extension_error_ui argument rather than using |
586 // the member variable to make it easier to test the method in isolation. | 586 // the member variable to make it easier to test the method in isolation. |
587 bool PopulateExtensionErrorUI(ExtensionErrorUI* extension_error_ui); | 587 bool PopulateExtensionErrorUI(ExtensionErrorUI* extension_error_ui); |
588 | 588 |
589 // Marks alertable extensions as acknowledged, after the user presses the | 589 // Checks if there are any new external extensions to notify the user about. |
590 // accept button. | 590 void UpdateExternalExtensionAlert(); |
591 void HandleExtensionAlertAccept(); | |
592 | 591 |
593 // Given a (presumably just-installed) extension id, mark that extension as | 592 // Given a (presumably just-installed) extension id, mark that extension as |
594 // acknowledged. | 593 // acknowledged. |
595 void AcknowledgeExternalExtension(const std::string& id); | 594 void AcknowledgeExternalExtension(const std::string& id); |
596 | 595 |
597 // Opens the Extensions page because the user wants to get more details | 596 // Opens the Extensions page because the user wants to get more details |
598 // about the alerts. | 597 // about the alerts. |
599 void HandleExtensionAlertDetails(); | 598 void HandleExtensionAlertDetails(); |
600 | 599 |
601 // Called when the extension alert is closed. | 600 // Called when the extension alert is closed. |
602 void HandleExtensionAlertClosed(); | 601 void HandleExtensionAlertClosed(); |
603 | 602 |
| 603 // Marks alertable extensions as acknowledged, after the user presses the |
| 604 // accept button. |
| 605 void HandleExtensionAlertAccept(); |
| 606 |
604 // content::NotificationObserver | 607 // content::NotificationObserver |
605 virtual void Observe(int type, | 608 virtual void Observe(int type, |
606 const content::NotificationSource& source, | 609 const content::NotificationSource& source, |
607 const content::NotificationDetails& details) OVERRIDE; | 610 const content::NotificationDetails& details) OVERRIDE; |
608 | 611 |
609 // Whether there are any apps installed. Component apps are not included. | 612 // Whether there are any apps installed. Component apps are not included. |
610 bool HasApps() const; | 613 bool HasApps() const; |
611 | 614 |
612 // Gets the set of loaded app ids. Component apps are not included. | 615 // Gets the set of loaded app ids. Component apps are not included. |
613 extensions::ExtensionIdSet GetAppIds() const; | 616 extensions::ExtensionIdSet GetAppIds() const; |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); | 730 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); |
728 | 731 |
729 // Enqueues a launch task in the lazy background page queue. | 732 // Enqueues a launch task in the lazy background page queue. |
730 void QueueRestoreAppWindow(const extensions::Extension* extension); | 733 void QueueRestoreAppWindow(const extensions::Extension* extension); |
731 // Launches the platform app associated with |extension_host|. | 734 // Launches the platform app associated with |extension_host|. |
732 static void LaunchApplication(extensions::ExtensionHost* extension_host); | 735 static void LaunchApplication(extensions::ExtensionHost* extension_host); |
733 | 736 |
734 // Helper to inspect an ExtensionHost after it has been loaded. | 737 // Helper to inspect an ExtensionHost after it has been loaded. |
735 void InspectExtensionHost(extensions::ExtensionHost* host); | 738 void InspectExtensionHost(extensions::ExtensionHost* host); |
736 | 739 |
| 740 // Helper to determine whether we should initially enable an installed |
| 741 // (or upgraded) extension. |
| 742 bool ShouldEnableOnInstall(const extensions::Extension* extension); |
| 743 |
737 // The normal profile associated with this ExtensionService. | 744 // The normal profile associated with this ExtensionService. |
738 Profile* profile_; | 745 Profile* profile_; |
739 | 746 |
740 // The ExtensionSystem for the profile above. | 747 // The ExtensionSystem for the profile above. |
741 extensions::ExtensionSystem* system_; | 748 extensions::ExtensionSystem* system_; |
742 | 749 |
743 // Preferences for the owning profile (weak reference). | 750 // Preferences for the owning profile (weak reference). |
744 extensions::ExtensionPrefs* extension_prefs_; | 751 extensions::ExtensionPrefs* extension_prefs_; |
745 | 752 |
746 // Settings for the owning profile. | 753 // Settings for the owning profile. |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 #endif | 895 #endif |
889 | 896 |
890 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 897 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
891 InstallAppsWithUnlimtedStorage); | 898 InstallAppsWithUnlimtedStorage); |
892 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 899 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
893 InstallAppsAndCheckStorageProtection); | 900 InstallAppsAndCheckStorageProtection); |
894 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 901 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
895 }; | 902 }; |
896 | 903 |
897 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 904 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |