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

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

Issue 518083: Make sure that pointer to the ExtensionsService is valid in the extensions infobars. (Closed)
Patch Set: Created 10 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/extensions/crashed_extension_infobar.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_CRASHED_EXTENSION_INFOBAR_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_
6 #define CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_ 6 #define CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "chrome/browser/tab_contents/infobar_delegate.h" 11 #include "chrome/browser/tab_contents/infobar_delegate.h"
12 12
13 class Extension; 13 class Extension;
14 class ExtensionsService; 14 class ExtensionsService;
15 class SkBitmap; 15 class SkBitmap;
16 16
17 // This infobar will be displayed when an extension process crashes. It allows 17 // This infobar will be displayed when an extension process crashes. It allows
18 // the user to reload the crashed extension. 18 // the user to reload the crashed extension.
19 class CrashedExtensionInfoBarDelegate : public ConfirmInfoBarDelegate { 19 class CrashedExtensionInfoBarDelegate : public ConfirmInfoBarDelegate {
20 public: 20 public:
21 // |tab_contents| should point to the TabContents the infobar will be added 21 // |tab_contents| should point to the TabContents the infobar will be added
22 // to. |extension| should be the crashed extension, and |extensions_service| 22 // to. |extension| should be the crashed extension, and |extensions_service|
23 // the ExtensionsService which manages that extension. 23 // the ExtensionsService which manages that extension.
24 CrashedExtensionInfoBarDelegate(TabContents* tab_contents, 24 CrashedExtensionInfoBarDelegate(TabContents* tab_contents,
25 ExtensionsService* extensions_service, 25 ExtensionsService* extensions_service,
26 const Extension* extension); 26 const Extension* extension);
27 ~CrashedExtensionInfoBarDelegate();
27 28
28 // ConfirmInfoBarDelegate 29 // ConfirmInfoBarDelegate
29 virtual std::wstring GetMessageText() const; 30 virtual std::wstring GetMessageText() const;
30 virtual void InfoBarClosed(); 31 virtual void InfoBarClosed();
31 virtual SkBitmap* GetIcon() const; 32 virtual SkBitmap* GetIcon() const;
32 virtual int GetButtons() const; 33 virtual int GetButtons() const;
33 virtual std::wstring GetButtonLabel( 34 virtual std::wstring GetButtonLabel(
34 ConfirmInfoBarDelegate::InfoBarButton button) const; 35 ConfirmInfoBarDelegate::InfoBarButton button) const;
35 virtual bool Accept(); 36 virtual bool Accept();
36 37
37 private: 38 private:
38 ExtensionsService* extensions_service_; 39 scoped_refptr<ExtensionsService> extensions_service_;
39 40
40 const std::string extension_id_; 41 const std::string extension_id_;
41 const std::string extension_name_; 42 const std::string extension_name_;
42 43
43 DISALLOW_COPY_AND_ASSIGN(CrashedExtensionInfoBarDelegate); 44 DISALLOW_COPY_AND_ASSIGN(CrashedExtensionInfoBarDelegate);
44 }; 45 };
45 46
46 #endif // CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_ 47 #endif // CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/crashed_extension_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698