| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_EXTERNAL_INSTALL_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 // Returns the current install error, if one exists. | 51 // Returns the current install error, if one exists. |
| 52 const ExternalInstallError* error() { return error_.get(); } | 52 const ExternalInstallError* error() { return error_.get(); } |
| 53 | 53 |
| 54 // Returns a mutable copy of the error for testing purposes. | 54 // Returns a mutable copy of the error for testing purposes. |
| 55 ExternalInstallError* error_for_testing() { return error_.get(); } | 55 ExternalInstallError* error_for_testing() { return error_.get(); } |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // ExtensionRegistryObserver implementation. | 58 // ExtensionRegistryObserver implementation. |
| 59 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, | 59 virtual void OnExtensionLoaded(content::BrowserContext* browser_context, |
| 60 const Extension* extension) OVERRIDE; | 60 const Extension* extension) override; |
| 61 virtual void OnExtensionInstalled(content::BrowserContext* browser_context, | 61 virtual void OnExtensionInstalled(content::BrowserContext* browser_context, |
| 62 const Extension* extension, | 62 const Extension* extension, |
| 63 bool is_update) OVERRIDE; | 63 bool is_update) override; |
| 64 virtual void OnExtensionUninstalled( | 64 virtual void OnExtensionUninstalled( |
| 65 content::BrowserContext* browser_context, | 65 content::BrowserContext* browser_context, |
| 66 const Extension* extension, | 66 const Extension* extension, |
| 67 extensions::UninstallReason reason) OVERRIDE; | 67 extensions::UninstallReason reason) override; |
| 68 | 68 |
| 69 // content::NotificationObserver implementation. | 69 // content::NotificationObserver implementation. |
| 70 virtual void Observe(int type, | 70 virtual void Observe(int type, |
| 71 const content::NotificationSource& source, | 71 const content::NotificationSource& source, |
| 72 const content::NotificationDetails& details) OVERRIDE; | 72 const content::NotificationDetails& details) override; |
| 73 | 73 |
| 74 // Adds a global error informing the user that an external extension was | 74 // Adds a global error informing the user that an external extension was |
| 75 // installed. If |is_new_profile| is true, then this error is from the first | 75 // installed. If |is_new_profile| is true, then this error is from the first |
| 76 // time our profile checked for new extensions. | 76 // time our profile checked for new extensions. |
| 77 void AddExternalInstallError(const Extension* extension, bool is_new_profile); | 77 void AddExternalInstallError(const Extension* extension, bool is_new_profile); |
| 78 | 78 |
| 79 // Returns true if this extension is an external one that has yet to be | 79 // Returns true if this extension is an external one that has yet to be |
| 80 // marked as acknowledged. | 80 // marked as acknowledged. |
| 81 bool IsUnacknowledgedExternalExtension(const Extension* extension) const; | 81 bool IsUnacknowledgedExternalExtension(const Extension* extension) const; |
| 82 | 82 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 96 | 96 |
| 97 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 97 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
| 98 extension_registry_observer_; | 98 extension_registry_observer_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(ExternalInstallManager); | 100 DISALLOW_COPY_AND_ASSIGN(ExternalInstallManager); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace extensions | 103 } // namespace extensions |
| 104 | 104 |
| 105 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_MANAGER_H_ | 105 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_INSTALL_MANAGER_H_ |
| OLD | NEW |