Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: chrome/browser/extensions/extension_global_error.h

Issue 10696210: Making ExtensionService less dependent on Browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update based on discussion with Yoyo Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/ui/global_error/global_error.h"
11 #include "chrome/common/extensions/extension.h"
12
13 class Browser;
14 class ExtensionService;
15
16 // This class encapsulates the UI we want to show users when certain events
17 // occur related to installed extensions.
18 class ExtensionGlobalError : public GlobalError {
19 public:
20 explicit ExtensionGlobalError(ExtensionService* extension_service);
21 virtual ~ExtensionGlobalError();
22
23 // Inform us that a given extension is of a certain type that the user
24 // hasn't yet acknowledged.
25 void AddExternalExtension(const std::string& id);
26 void AddBlacklistedExtension(const std::string& id);
27 void AddOrphanedExtension(const std::string& id);
28
29 // Returns sets replaying the IDs that have been added with the
30 // Add[...]Extension methods.
31 const extensions::ExtensionIdSet* get_external_extension_ids() const {
32 return external_extension_ids_.get();
33 }
34
35 const extensions::ExtensionIdSet* get_blacklisted_extension_ids() const {
36 return blacklisted_extension_ids_.get();
37 }
38
39 const extensions::ExtensionIdSet* get_orphaned_extension_ids() const {
40 return orphaned_extension_ids_.get();
41 }
42
43 // GlobalError methods.
44 virtual bool HasBadge() OVERRIDE;
45 virtual bool HasMenuItem() OVERRIDE;
46 virtual int MenuItemCommandID() OVERRIDE;
47 virtual string16 MenuItemLabel() OVERRIDE;
48 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE;
49 virtual bool HasBubbleView() OVERRIDE;
50 virtual string16 GetBubbleViewTitle() OVERRIDE;
51 virtual string16 GetBubbleViewMessage() OVERRIDE;
52 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE;
53 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE;
54 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE;
55 virtual void BubbleViewAcceptButtonPressed(Browser* browser) OVERRIDE;
56 virtual void BubbleViewCancelButtonPressed(Browser* browser) OVERRIDE;
57
58 private:
59 bool should_delete_self_on_close_;
60 ExtensionService* extension_service_;
61 scoped_ptr<extensions::ExtensionIdSet> external_extension_ids_;
62 scoped_ptr<extensions::ExtensionIdSet> blacklisted_extension_ids_;
63 scoped_ptr<extensions::ExtensionIdSet> orphaned_extension_ids_;
64 string16 message_; // Displayed in the body of the alert.
65
66 // For a given set of extension IDs, generates appropriate text
67 // describing what the user needs to know about them.
68 string16 GenerateMessageSection(const extensions::ExtensionIdSet* extensions,
69 int template_message_id);
70
71 // Generates the message displayed in the body of the alert.
72 string16 GenerateMessage();
73
74 DISALLOW_COPY_AND_ASSIGN(ExtensionGlobalError);
75 };
76
77 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_GLOBAL_ERROR_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_error_ui_default.cc ('k') | chrome/browser/extensions/extension_global_error.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698