summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 17:01:47 +0000
committermaruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-08 17:01:47 +0000
commitf278b8124a142c796d2389f8d421e2f5bedb186b (patch)
tree946248a805cce2e1e3d24c00410ea69da5e20e73
parent6bcae2e6f57eaff7773f103f0939fbecc5a96149 (diff)
downloadchromium_src-f278b8124a142c796d2389f8d421e2f5bedb186b.zip
chromium_src-f278b8124a142c796d2389f8d421e2f5bedb186b.tar.gz
chromium_src-f278b8124a142c796d2389f8d421e2f5bedb186b.tar.bz2
Adds an --incognito switch that can be used to launch Chrome in Incognito mode.
You can combine this with --app= to launch an app in Chrome that has no effect on the user's profile. Note that this is not the same thing as launching chrome.exe --user-data-dir=/dev/null, which would give you an completely empty profile instead of loading the user's profile as read-only. BUG=1790,2012 Patch by Yarin Kaul <yarin.kaul@gmail.com> Review URL: http://codereview.chromium.org/6584 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3013 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--AUTHORS1
-rw-r--r--chrome/browser/browser_init.cc4
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
4 files changed, 9 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
index ed6d78c..2cd1faa 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -14,4 +14,5 @@ Matthias Reitinger <reimarvin@gmail.com>
Peter Bright <drpizza@quiscalusmexicanus.org>
Arthur Lussos <developer0420@gmail.com>
Masahiro Yado <yado.masa@gmail.com>
+Yarin Kaul <yarin.kaul@gmail.com>
Gaetano Mendola <mendola@gmail.com>
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc
index 859b94b..a9e0134 100644
--- a/chrome/browser/browser_init.cc
+++ b/chrome/browser/browser_init.cc
@@ -668,6 +668,10 @@ bool BrowserInit::LaunchBrowser(const CommandLine& parsed_command_line,
bool process_startup, int* return_code) {
DCHECK(profile);
+ // Continue with the off-the-record profile from here on if --incognito
+ if (parsed_command_line.HasSwitch(switches::kIncognito))
+ profile = profile->GetOffTheRecordProfile();
+
// Are we starting an application?
std::wstring app_url = parsed_command_line.GetSwitchValue(switches::kApp);
if (!app_url.empty()) {
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c8e956a..2224e39 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -330,6 +330,9 @@ const wchar_t kEnableP13n[] = L"enable-p13n";
// SDCH is currently only supported server-side for searches on google.com.
const wchar_t kSdchFilter[] = L"enable-sdch";
+// Causes the browser to launch directly in incognito mode.
+const wchar_t kIncognito[] = L"incognito";
+
// Turn on an experimental implementation of SafeBrowsing which improves
// performance during updates by avoiding the enormous IO from SQLite
// operations.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index a3c89e3..79c1d05 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -128,6 +128,7 @@ extern const wchar_t kEnableP13n[];
extern const wchar_t kSdchFilter[];
+extern const wchar_t kIncognito[];
extern const wchar_t kUseNewSafeBrowsing[];
} // namespace switches