Index: chrome/browser/ui/startup/startup_browser_creator_impl.cc |
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
index df06bd84fefdcfd7095f677f5ce3b323aeb82407..14e97210c87e76d776ddd15a248ba68812da5600 100644 |
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc |
@@ -453,8 +453,12 @@ void StartupBrowserCreatorImpl::ExtractOptionalAppWindowSize( |
} |
} |
-bool StartupBrowserCreatorImpl::IsAppLaunch(std::string* app_url, |
+bool StartupBrowserCreatorImpl::IsAppLaunch(Profile* profile, |
+ std::string* app_url, |
std::string* app_id) { |
+ // Don't launch apps in incognito mode. |
+ if (profile->IsOffTheRecord()) |
+ return false; |
if (command_line_.HasSwitch(switches::kApp)) { |
if (app_url) |
*app_url = command_line_.GetSwitchValueASCII(switches::kApp); |
@@ -474,7 +478,7 @@ bool StartupBrowserCreatorImpl::OpenApplicationTab(Profile* profile) { |
// function will open an app that should be in a tab, there is no need |
// to look at the app URL. OpenApplicationWindow() will open app url |
// shortcuts. |
- if (!IsAppLaunch(NULL, &app_id) || app_id.empty()) |
+ if (!IsAppLaunch(profile, NULL, &app_id) || app_id.empty()) |
return false; |
extension_misc::LaunchContainer launch_container; |
@@ -502,7 +506,7 @@ bool StartupBrowserCreatorImpl::OpenApplicationWindow( |
*out_app_contents = NULL; |
std::string url_string, app_id; |
- if (!IsAppLaunch(&url_string, &app_id)) |
+ if (!IsAppLaunch(profile, &url_string, &app_id)) |
return false; |
// This can fail if the app_id is invalid. It can also fail if the |