Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7710)

Unified Diff: chrome/browser/ui/startup/startup_browser_creator_impl.cc

Issue 12380047: Allow --app-list to be used in conjunction with --incognito for v1 apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 11b9c4ff6f9946a8d35e3a7eafa3922c213db73b..c8ef52165227e198446b9e35c818e18da57c12fa 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
@@ -193,6 +193,10 @@ bool GetAppLaunchContainer(
if (!extension)
return false;
+ // Don't launch platform apps in incognito mode.
+ if (profile->IsOffTheRecord() && extension->is_platform_app())
+ return false;
+
// Look at preferences to find the right launch container. If no
// preference is set, launch as a window.
extension_misc::LaunchContainer launch_container =
@@ -396,12 +400,8 @@ void StartupBrowserCreatorImpl::ExtractOptionalAppWindowSize(
}
}
-bool StartupBrowserCreatorImpl::IsAppLaunch(Profile* profile,
- std::string* app_url,
+bool StartupBrowserCreatorImpl::IsAppLaunch(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);
@@ -421,7 +421,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(profile, NULL, &app_id) || app_id.empty())
+ if (!IsAppLaunch(NULL, &app_id) || app_id.empty())
return false;
extension_misc::LaunchContainer launch_container;
@@ -448,7 +448,7 @@ bool StartupBrowserCreatorImpl::OpenApplicationWindow(
*out_app_contents = NULL;
std::string url_string, app_id;
- if (!IsAppLaunch(profile, &url_string, &app_id))
+ if (!IsAppLaunch(&url_string, &app_id))
return false;
// This can fail if the app_id is invalid. It can also fail if the
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698