| 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_GLOBAL_ERROR_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 virtual ~ExtensionGlobalError(); | 22 virtual ~ExtensionGlobalError(); |
| 23 | 23 |
| 24 // Inform us that a given extension is of a certain type that the user | 24 // Inform us that a given extension is of a certain type that the user |
| 25 // hasn't yet acknowledged. | 25 // hasn't yet acknowledged. |
| 26 void AddExternalExtension(const std::string& id); | 26 void AddExternalExtension(const std::string& id); |
| 27 void AddBlacklistedExtension(const std::string& id); | 27 void AddBlacklistedExtension(const std::string& id); |
| 28 void AddOrphanedExtension(const std::string& id); | 28 void AddOrphanedExtension(const std::string& id); |
| 29 | 29 |
| 30 // Returns sets replaying the IDs that have been added with the | 30 // Returns sets replaying the IDs that have been added with the |
| 31 // Add[...]Extension methods. | 31 // Add[...]Extension methods. |
| 32 const ExtensionIdSet* get_external_extension_ids() const { | 32 const extensions::ExtensionIdSet* get_external_extension_ids() const { |
| 33 return external_extension_ids_.get(); | 33 return external_extension_ids_.get(); |
| 34 } | 34 } |
| 35 | 35 |
| 36 const ExtensionIdSet* get_blacklisted_extension_ids() const { | 36 const extensions::ExtensionIdSet* get_blacklisted_extension_ids() const { |
| 37 return blacklisted_extension_ids_.get(); | 37 return blacklisted_extension_ids_.get(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 const ExtensionIdSet* get_orphaned_extension_ids() const { | 40 const extensions::ExtensionIdSet* get_orphaned_extension_ids() const { |
| 41 return orphaned_extension_ids_.get(); | 41 return orphaned_extension_ids_.get(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // GlobalError methods. | 44 // GlobalError methods. |
| 45 virtual bool HasBadge() OVERRIDE; | 45 virtual bool HasBadge() OVERRIDE; |
| 46 virtual bool HasMenuItem() OVERRIDE; | 46 virtual bool HasMenuItem() OVERRIDE; |
| 47 virtual int MenuItemCommandID() OVERRIDE; | 47 virtual int MenuItemCommandID() OVERRIDE; |
| 48 virtual string16 MenuItemLabel() OVERRIDE; | 48 virtual string16 MenuItemLabel() OVERRIDE; |
| 49 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; | 49 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE; |
| 50 virtual bool HasBubbleView() OVERRIDE; | 50 virtual bool HasBubbleView() OVERRIDE; |
| 51 virtual string16 GetBubbleViewTitle() OVERRIDE; | 51 virtual string16 GetBubbleViewTitle() OVERRIDE; |
| 52 virtual string16 GetBubbleViewMessage() OVERRIDE; | 52 virtual string16 GetBubbleViewMessage() OVERRIDE; |
| 53 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; | 53 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE; |
| 54 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; | 54 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE; |
| 55 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; | 55 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE; |
| 56 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; | 56 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE; |
| 57 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; | 57 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 bool should_delete_self_on_close_; | 60 bool should_delete_self_on_close_; |
| 61 ExtensionService* extension_service_; | 61 ExtensionService* extension_service_; |
| 62 scoped_ptr<ExtensionIdSet> external_extension_ids_; | 62 scoped_ptr<extensions::ExtensionIdSet> external_extension_ids_; |
| 63 scoped_ptr<ExtensionIdSet> blacklisted_extension_ids_; | 63 scoped_ptr<extensions::ExtensionIdSet> blacklisted_extension_ids_; |
| 64 scoped_ptr<ExtensionIdSet> orphaned_extension_ids_; | 64 scoped_ptr<extensions::ExtensionIdSet> orphaned_extension_ids_; |
| 65 string16 message_; // Displayed in the body of the alert. | 65 string16 message_; // Displayed in the body of the alert. |
| 66 | 66 |
| 67 // For a given set of extension IDs, generates appropriate text | 67 // For a given set of extension IDs, generates appropriate text |
| 68 // describing what the user needs to know about them. | 68 // describing what the user needs to know about them. |
| 69 string16 GenerateMessageSection(const ExtensionIdSet* extensions, | 69 string16 GenerateMessageSection(const extensions::ExtensionIdSet* extensions, |
| 70 int template_message_id); | 70 int template_message_id); |
| 71 | 71 |
| 72 // Generates the message displayed in the body of the alert. | 72 // Generates the message displayed in the body of the alert. |
| 73 string16 GenerateMessage(); | 73 string16 GenerateMessage(); |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(ExtensionGlobalError); | 75 DISALLOW_COPY_AND_ASSIGN(ExtensionGlobalError); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_ | 78 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_ |
| OLD | NEW |