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_ERROR_UI_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/ui/global_error/global_error.h" | 10 #include "chrome/browser/ui/global_error/global_error.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // synchronously. | 50 // synchronously. |
51 virtual void Close() = 0; | 51 virtual void Close() = 0; |
52 | 52 |
53 protected: | 53 protected: |
54 explicit ExtensionErrorUI(ExtensionService* extension_service); | 54 explicit ExtensionErrorUI(ExtensionService* extension_service); |
55 | 55 |
56 ExtensionService* extension_service() const { return extension_service_; } | 56 ExtensionService* extension_service() const { return extension_service_; } |
57 | 57 |
58 // Model methods for the bubble view. | 58 // Model methods for the bubble view. |
59 string16 GetBubbleViewTitle(); | 59 string16 GetBubbleViewTitle(); |
60 string16 GetBubbleViewMessage(); | 60 std::vector<string16> GetBubbleViewMessages(); |
61 string16 GetBubbleViewAcceptButtonLabel(); | 61 string16 GetBubbleViewAcceptButtonLabel(); |
62 string16 GetBubbleViewCancelButtonLabel(); | 62 string16 GetBubbleViewCancelButtonLabel(); |
63 | 63 |
64 // Sub-classes should call this methods based on the actions taken by the user | 64 // Sub-classes should call this methods based on the actions taken by the user |
65 // in the error bubble. | 65 // in the error bubble. |
66 void BubbleViewDidClose(); // destroys |this| | 66 void BubbleViewDidClose(); // destroys |this| |
67 void BubbleViewAcceptButtonPressed(); | 67 void BubbleViewAcceptButtonPressed(); |
68 void BubbleViewCancelButtonPressed(); | 68 void BubbleViewCancelButtonPressed(); |
69 | 69 |
70 private: | 70 private: |
71 bool should_delete_self_on_close_; | 71 bool should_delete_self_on_close_; |
72 ExtensionService* extension_service_; | 72 ExtensionService* extension_service_; |
73 scoped_ptr<extensions::ExtensionIdSet> external_extension_ids_; | 73 scoped_ptr<extensions::ExtensionIdSet> external_extension_ids_; |
74 scoped_ptr<extensions::ExtensionIdSet> blacklisted_extension_ids_; | 74 scoped_ptr<extensions::ExtensionIdSet> blacklisted_extension_ids_; |
75 string16 message_; // Displayed in the body of the alert. | 75 string16 message_; // Displayed in the body of the alert. |
76 | 76 |
77 // For a given set of extension IDs, generates appropriate text | 77 // For a given set of extension IDs, generates appropriate text |
78 // describing what the user needs to know about them. | 78 // describing what the user needs to know about them. |
79 string16 GenerateMessageSection(const extensions::ExtensionIdSet* extensions, | 79 string16 GenerateMessageSection(const extensions::ExtensionIdSet* extensions, |
80 int extension_template_message_id, | 80 int extension_template_message_id, |
81 int app_template_message_id); | 81 int app_template_message_id); |
82 | 82 |
83 // Generates the message displayed in the body of the alert. | 83 // Generates the message displayed in the body of the alert. |
84 string16 GenerateMessage(); | 84 string16 GenerateMessage(); |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorUI); | 86 DISALLOW_COPY_AND_ASSIGN(ExtensionErrorUI); |
87 }; | 87 }; |
88 | 88 |
89 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_H_ | 89 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ERROR_UI_H_ |
OLD | NEW |