| 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_EXTENSION_ERROR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/extensions/extension_error_ui.h" | 9 #include "chrome/browser/extensions/extension_error_ui.h" |
| 10 #include "extensions/common/extension_set.h" | 10 #include "extensions/common/extension_set.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 ExtensionErrorController(content::BrowserContext* context, bool is_first_run); | 25 ExtensionErrorController(content::BrowserContext* context, bool is_first_run); |
| 26 virtual ~ExtensionErrorController(); | 26 virtual ~ExtensionErrorController(); |
| 27 | 27 |
| 28 void ShowErrorIfNeeded(); | 28 void ShowErrorIfNeeded(); |
| 29 | 29 |
| 30 // Set the factory method for creating a new ExtensionErrorUI. | 30 // Set the factory method for creating a new ExtensionErrorUI. |
| 31 static void SetUICreateMethodForTesting(UICreateMethod method); | 31 static void SetUICreateMethodForTesting(UICreateMethod method); |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 // ExtensionErrorUI::Delegate implementation: | 34 // ExtensionErrorUI::Delegate implementation: |
| 35 virtual content::BrowserContext* GetContext() OVERRIDE; | 35 virtual content::BrowserContext* GetContext() override; |
| 36 virtual const ExtensionSet& GetExternalExtensions() OVERRIDE; | 36 virtual const ExtensionSet& GetExternalExtensions() override; |
| 37 virtual const ExtensionSet& GetBlacklistedExtensions() OVERRIDE; | 37 virtual const ExtensionSet& GetBlacklistedExtensions() override; |
| 38 virtual void OnAlertDetails() OVERRIDE; | 38 virtual void OnAlertDetails() override; |
| 39 virtual void OnAlertAccept() OVERRIDE; | 39 virtual void OnAlertAccept() override; |
| 40 virtual void OnAlertClosed() OVERRIDE; | 40 virtual void OnAlertClosed() override; |
| 41 | 41 |
| 42 // Find any extensions that the user should be alerted about (like blacklisted | 42 // Find any extensions that the user should be alerted about (like blacklisted |
| 43 // extensions). | 43 // extensions). |
| 44 void IdentifyAlertableExtensions(); | 44 void IdentifyAlertableExtensions(); |
| 45 | 45 |
| 46 // TODO(rdevlin.cronin): We never seem to use |external_extensions_| here, | 46 // TODO(rdevlin.cronin): We never seem to use |external_extensions_| here, |
| 47 // but we do warn about them. Investigate more. | 47 // but we do warn about them. Investigate more. |
| 48 ExtensionSet external_extensions_; | 48 ExtensionSet external_extensions_; |
| 49 | 49 |
| 50 // The extensions that are blacklisted and need user approval. | 50 // The extensions that are blacklisted and need user approval. |
| 51 ExtensionSet blacklisted_extensions_; | 51 ExtensionSet blacklisted_extensions_; |
| 52 | 52 |
| 53 // The UI component of this controller. | 53 // The UI component of this controller. |
| 54 scoped_ptr<ExtensionErrorUI> error_ui_; | 54 scoped_ptr<ExtensionErrorUI> error_ui_; |
| 55 | 55 |
| 56 // The BrowserContext with which we are associated. | 56 // The BrowserContext with which we are associated. |
| 57 content::BrowserContext* browser_context_; | 57 content::BrowserContext* browser_context_; |
| 58 | 58 |
| 59 // Whether or not this is the first run. If it is, we avoid noisy errors, and | 59 // Whether or not this is the first run. If it is, we avoid noisy errors, and |
| 60 // silently acknowledge blacklisted extensions. | 60 // silently acknowledge blacklisted extensions. |
| 61 bool is_first_run_; | 61 bool is_first_run_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorController); | 63 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorController); |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 } // namespace extensions | 66 } // namespace extensions |
| 67 | 67 |
| 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_CONTROLLER_H_ | 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_CONTROLLER_H_ |
| OLD | NEW |