summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/crashed_extension_infobar.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 15:22:46 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-25 15:22:46 +0000
commit371ed7a0e83c44764fef64ddbf00996b5385271e (patch)
tree5328f866d0c39ab82837ff7c91d1a3741ab97174 /chrome/browser/extensions/crashed_extension_infobar.h
parent856c26be2a9a419033f93d79ba9ee43e04b20458 (diff)
downloadchromium_src-371ed7a0e83c44764fef64ddbf00996b5385271e.zip
chromium_src-371ed7a0e83c44764fef64ddbf00996b5385271e.tar.gz
chromium_src-371ed7a0e83c44764fef64ddbf00996b5385271e.tar.bz2
Fix "crashed extension" infobar browser crashes.
This is a general rework of how "crashed extension" infobar works and how the extension is actually recovered after the crash. This is a subset of original http://codereview.chromium.org/164151/ . I had to remove the part which unloads the entire extension on crash, because it interacts badly with other parts of the browser. I'm fixing that. TEST=See bug. http://crbug.com/15888 Review URL: http://codereview.chromium.org/173314 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/crashed_extension_infobar.h')
-rw-r--r--chrome/browser/extensions/crashed_extension_infobar.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/chrome/browser/extensions/crashed_extension_infobar.h b/chrome/browser/extensions/crashed_extension_infobar.h
new file mode 100644
index 0000000..4a4e625
--- /dev/null
+++ b/chrome/browser/extensions/crashed_extension_infobar.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_
+#define CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "chrome/browser/tab_contents/infobar_delegate.h"
+
+class Extension;
+class ExtensionsService;
+class SkBitmap;
+
+// This infobar will be displayed when an extension process crashes. It allows
+// the user to reload the crashed extension.
+class CrashedExtensionInfoBarDelegate : public ConfirmInfoBarDelegate {
+ public:
+ // |tab_contents| should point to the TabContents the infobar will be added
+ // to. |extension| should be the crashed extension, and |extensions_service|
+ // the ExtensionsService which manages that extension.
+ CrashedExtensionInfoBarDelegate(TabContents* tab_contents,
+ ExtensionsService* extensions_service,
+ const Extension* extension);
+
+ // ConfirmInfoBarDelegate
+ virtual std::wstring GetMessageText() const;
+ virtual void InfoBarClosed();
+ virtual SkBitmap* GetIcon() const;
+ virtual int GetButtons() const;
+ virtual std::wstring GetButtonLabel(
+ ConfirmInfoBarDelegate::InfoBarButton button) const;
+ virtual bool Accept();
+
+ private:
+ ExtensionsService* extensions_service_;
+
+ const std::string extension_id_;
+ const std::string extension_name_;
+
+ DISALLOW_COPY_AND_ASSIGN(CrashedExtensionInfoBarDelegate);
+};
+
+#endif // CHROME_BROWSER_EXTENSIONS_CRASHED_EXTENSION_INFOBAR_H_