summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 01:46:08 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-21 01:46:08 +0000
commit398206ce0943c935a8da55d382e60e7be16099cf (patch)
treef45ab7ef6f6c101b142a7d5c1393c6455caf2e70 /chrome/common
parent0965c6d6d392916a4017bce6ddf5fef8d5bcd22a (diff)
downloadchromium_src-398206ce0943c935a8da55d382e60e7be16099cf.zip
chromium_src-398206ce0943c935a8da55d382e60e7be16099cf.tar.gz
chromium_src-398206ce0943c935a8da55d382e60e7be16099cf.tar.bz2
Added BackgroundContentsService to manage lifecycle of BackgroundContents.
If --restore-background-contents flag is passed, stores the URLs of running BackgroundContents in preferences so they can be re-launched when the browser restarts. Moved logic to shutdown background contents into BackgroundContentsService so we can use this to coordinate when to keep the browser process running. BUG=43382 TEST=new tests Review URL: http://codereview.chromium.org/2104018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_switches.cc7
-rw-r--r--chrome/common/chrome_switches.h2
-rw-r--r--chrome/common/notification_type.h15
-rw-r--r--chrome/common/pref_names.cc5
-rw-r--r--chrome/common/pref_names.h2
5 files changed, 25 insertions, 6 deletions
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index f5b6dac..da839ae 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -514,9 +514,6 @@ const char kLoadExtension[] = "load-extension";
// Load an NPAPI plugin from the specified path.
const char kLoadPlugin[] = "load-plugin";
-// Long lived extensions.
-const char kLongLivedExtensions[] = "long-lived-extensions";
-
// Will filter log messages to show only the messages that are prefixed
// with the specified value. See also kEnableLogging and kLoggingLevel.
const char kLogFilterPrefix[] = "log-filter-prefix";
@@ -711,6 +708,10 @@ const char kRendererProcess[] = "renderer";
// Causes the renderer process to display a dialog on launch.
const char kRendererStartupDialog[] = "renderer-startup-dialog";
+// Causes the URLs of BackgroundContents to be remembered and re-launched when
+// the browser restarts.
+const char kRestoreBackgroundContents[] = "restore-background-contents";
+
// Indicates the last session should be restored on startup. This overrides
// the preferences value and is primarily intended for testing. The value of
// this switch is the number of tabs to wait until loaded before
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index a6ea1d4..3144673 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -154,7 +154,6 @@ extern const char kInternalPepper[];
extern const char kJavaScriptFlags[];
extern const char kLoadExtension[];
extern const char kLoadPlugin[];
-extern const char kLongLivedExtensions[];
extern const char kLogFilterPrefix[];
extern const char kLogPluginMessages[];
extern const char kLoggingLevel[];
@@ -203,6 +202,7 @@ extern const char kRendererCmdPrefix[];
extern const char kRendererCrashTest[];
extern const char kRendererProcess[];
extern const char kRendererStartupDialog[];
+extern const char kRestoreBackgroundContents[];
extern const char kRestoreLastSession[];
extern const char kSafePlugins[];
extern const char kSdchFilter[];
diff --git a/chrome/common/notification_type.h b/chrome/common/notification_type.h
index f47088c..93145d1 100644
--- a/chrome/common/notification_type.h
+++ b/chrome/common/notification_type.h
@@ -482,12 +482,23 @@ class NotificationType {
// BackgroundContents ------------------------------------------------------
+ // A new background contents was opened by script. The source is the parent
+ // profile and the details are BackgroundContentsOpenedDetails.
+ BACKGROUND_CONTENTS_OPENED,
+
// The background contents navigated to a new location. The source is the
- // BackgroundContents, and the details are contained RenderViewHost.
+ // parent Profile, and the details are the BackgroundContents that was
+ // navigated.
BACKGROUND_CONTENTS_NAVIGATED,
+ // The background contents were closed by someone invoking window.close()
+ // or the parent application was uninstalled.
+ // The source is the parent profile, and the details are the
+ // BackgroundContents.
+ BACKGROUND_CONTENTS_CLOSED,
+
// The background contents is being deleted. The source is the
- // BackgroundContents, and the details are the contained RendeViewHost.
+ // parent Profile, and the details are the BackgroundContents being deleted.
BACKGROUND_CONTENTS_DELETED,
// Child Processes ---------------------------------------------------------
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 9e13585..f3a8e2b 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -868,6 +868,11 @@ const wchar_t kLoginDatabaseMigrated[] = L"login_database.migrated";
// The root URL of the cloud print service.
const wchar_t kCloudPrintServiceURL[] = L"cloud_print.service_url";
+// The list of BackgroundContents that should be loaded when the browser
+// launches.
+const wchar_t kRegisteredBackgroundContents[] =
+ L"background_contents.registered";
+
// *************** SERVICE PREFS ***************
// These are attached to the service process.
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 192b598..6441e9d 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -336,6 +336,8 @@ extern const wchar_t kProxyServer[];
extern const wchar_t kProxyPacUrl[];
extern const wchar_t kProxyBypassList[];
+extern const wchar_t kRegisteredBackgroundContents[];
+
} // namespace prefs
#endif // CHROME_COMMON_PREF_NAMES_H_