summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/auto_launch_util.h
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-20 09:35:38 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-20 09:35:38 +0000
commitc149b9198168ca08da0a30d4fb63f0eb232d6001 (patch)
treea01d50991492a1d81b661cf0f67995aa0b44ba71 /chrome/installer/util/auto_launch_util.h
parent82d3954ae9ccbd99fc48b99296e70f63dc883010 (diff)
downloadchromium_src-c149b9198168ca08da0a30d4fb63f0eb232d6001.zip
chromium_src-c149b9198168ca08da0a30d4fb63f0eb232d6001.tar.gz
chromium_src-c149b9198168ca08da0a30d4fb63f0eb232d6001.tar.bz2
Resolve the conflict that auto-launch has with the background mode feature.
The Auto-launch experiment writes to the Run Registry key on Windows asking for Chrome to be started at login. The BackgroundModeManager writes to another Run Registry key asking for Chrome to be started without a window. We need to consolidate this into one Run key that specifies which feature you want as a command line flag to chrome.exe and make sure if a window is requested, then a window is shown (BackgroundModeManager doesn't care if the window is shown or not). BUG=123139, 53600 TEST=QA has testing instructions on how to test the experimental auto-launch feature (requires branded build). Not sure about testing instructions for background mode. Review URL: https://chromiumcodereview.appspot.com/9972012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/auto_launch_util.h')
-rw-r--r--chrome/installer/util/auto_launch_util.h76
1 files changed, 55 insertions, 21 deletions
diff --git a/chrome/installer/util/auto_launch_util.h b/chrome/installer/util/auto_launch_util.h
index bce8abd..977b28d 100644
--- a/chrome/installer/util/auto_launch_util.h
+++ b/chrome/installer/util/auto_launch_util.h
@@ -11,29 +11,63 @@
class FilePath;
// A namespace containing the platform specific implementation of setting Chrome
-// to launch on computer startup.
+// to launch at user login.
namespace auto_launch_util {
-// Returns whether the Chrome executable specified in |application_path| is set
-// to auto-launch at computer startup. NOTE: |application_path| is optional and
-// should be blank in most cases (as it will default to the application path of
-// the current executable). |profile_directory| is the name of the directory
-// (leaf, not the full path) that contains the profile that should be opened at
-// computer startup.
-bool WillLaunchAtLogin(const FilePath& application_path,
- const string16& profile_directory);
-
-// Configures whether the Chrome executable should auto-launch at computer
-// startup. |application_path| is needed when |auto_launch| is true AND when
-// the caller is not the process being set to auto-launch, ie. the installer.
-// This is because |application_path|, if left blank, defaults to the
-// application path of the current executable. If |auto_launch| is true, then it
-// will auto-launch, otherwise it will be configured not to. |profile_directory|
-// is the name of the directory (leaf, not the full path) that contains the
-// profile that should be opened at computer startup.
-void SetWillLaunchAtLogin(bool auto_launch,
- const FilePath& application_path,
- const string16& profile_directory);
+// Returns whether the Chrome executable in the directory |application_path| is
+// set to auto-start at user login.
+// |profile_directory| is the name of the directory (leaf, not the full path)
+// that contains the profile that should be opened at user login.
+// There are two flavors of auto-start, separated by whether a window is
+// requested at startup or not (called background mode). |window_requested|
+// specifies which flavor the caller is interested in.
+// NOTE: This function returns true only if the flavor the caller specifies has
+// been requested (or if both flavors have been requested). Therefore, it is
+// possible that Chrome auto-starts even if this function returns false (since
+// the other flavor might have been requested).
+// NOTE: Chrome being set to launch in the background (without a window)
+// does not necessarily mean that Chrome *will* launch without a window, since
+// when both flavors of the auto-start feature have been requested. In other
+// words, showing a window trumps not showing a window.
+// ALSO NOTE: |application_path| is optional and should be blank in most cases
+// (as it will default to the application path of the current executable).
+bool AutoStartRequested(const string16& profile_directory,
+ bool window_requested,
+ const FilePath& application_path);
+
+// Disables all auto-start features. |profile_directory| is the name of the
+// directory (leaf, not the full path) that contains the profile that was set
+// to be opened at user login.
+void DisableAllAutoStartFeatures(const string16& profile_directory);
+
+// Configures Chrome to auto-launch at user login and show a window. See also
+// EnableBackgroundStartAtLogin, which does the same, except without a window.
+// |profile_directory| is the name of the directory (leaf, not the full path)
+// that contains the profile that should be opened at user login.
+// |application_path| is needed when the caller is not the process being set to
+// auto-launch, ie. the installer. This is because |application_path|, if left
+// blank, defaults to the application path of the current executable.
+void EnableForegroundStartAtLogin(const string16& profile_directory,
+ const FilePath& application_path);
+
+// Disables auto-starting Chrome in foreground mode at user login.
+// |profile_directory| is the name of the directory (leaf, not the full path)
+// that contains the profile that was set to be opened at user login.
+// NOTE: Chrome may still launch if the other auto-start flavor is active
+// (background mode).
+void DisableForegroundStartAtLogin(const string16& profile_directory);
+
+// Requests that Chrome start in Background Mode at user login (without a
+// window being shown, except if EnableForegroundStartAtLogin has also been
+// called).
+// In short, EnableBackgroundStartAtLogin is the no-window version of calling
+// EnableForegroundStartAtLogin). If both are called, a window will be shown on
+// startup (foreground mode wins).
+void EnableBackgroundStartAtLogin();
+
+// Disables auto-starting Chrome in background mode at user login. Chrome may
+// still launch if the other auto-start flavor is active (foreground mode).
+void DisableBackgroundStartAtLogin();
} // namespace auto_launch_util