diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-02 06:33:29 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-02 06:33:29 +0000 |
commit | 2c4fb7ba69d1a8f2cf291d6f5588d8e2a8a9b396 (patch) | |
tree | 9810dac66c8452d4ac76175a4e23b41ab2f5b30d /chrome/browser/background_contents_service.h | |
parent | fc10e87033b603454c0893360182d64547f62441 (diff) | |
download | chromium_src-2c4fb7ba69d1a8f2cf291d6f5588d8e2a8a9b396.zip chromium_src-2c4fb7ba69d1a8f2cf291d6f5588d8e2a8a9b396.tar.gz chromium_src-2c4fb7ba69d1a8f2cf291d6f5588d8e2a8a9b396.tar.bz2 |
apps: Notify the user if an app's background page crashes.
Add a new notification for when an app's background page crashes, and use this
notification message to show a message to the user and allow to restart the app.
Extension-crashes also create balloon notifications instead of infobars.
BUG=78167,78126
TEST=existing ExtensionCrashRecoveryTest.* tests.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80128
Review URL: http://codereview.chromium.org/6731038
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80259 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_contents_service.h')
-rw-r--r-- | chrome/browser/background_contents_service.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/background_contents_service.h b/chrome/browser/background_contents_service.h index 1723ae7..1b388c7 100644 --- a/chrome/browser/background_contents_service.h +++ b/chrome/browser/background_contents_service.h @@ -10,6 +10,8 @@ #include <vector> #include "base/gtest_prod_util.h" +#include "base/memory/ref_counted.h" +#include "base/task.h" #include "chrome/browser/tab_contents/background_contents.h" #include "content/common/notification_observer.h" #include "content/common/notification_registrar.h" @@ -18,6 +20,8 @@ #include "webkit/glue/window_open_disposition.h" class CommandLine; +class DictionaryValue; +class NotificationDelegate; class PrefService; class Profile; class TabContents; @@ -74,10 +78,16 @@ class BackgroundContentsService : private NotificationObserver, const string16& frame_name, const string16& application_id); + // Load the registered BackgroundContents for the specified extension. This + // is typically used to reload a crashed background page. + void LoadBackgroundContentsForExtension(Profile* profile, + const std::string& extension_id); + private: friend class BackgroundContentsServiceTest; friend class MockBackgroundContents; friend class TaskManagerBrowserTest; + FRIEND_TEST_ALL_PREFIXES(BackgroundContentsServiceTest, BackgroundContentsCreateDestroy); FRIEND_TEST_ALL_PREFIXES(BackgroundContentsServiceTest, @@ -98,6 +108,12 @@ class BackgroundContentsService : private NotificationObserver, // Loads all registered BackgroundContents at startup. void LoadBackgroundContentsFromPrefs(Profile* profile); + // Load a BackgroundContent; the settings are read from the provided + // dictionary. + void LoadBackgroundContentsFromDictionary(Profile* profile, + const std::string& extension_id, + const DictionaryValue* contents); + // Creates a single BackgroundContents associated with the specified |appid|, // creates an associated RenderView with the name specified by |frame_name|, // and navigates to the passed |url|. |