summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-04 02:12:14 +0000
committerkoz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-04 02:12:14 +0000
commit0456654a270dda5e50a7ee8d58d7e7df07ac6c1c (patch)
tree15bfda48f1da1a7e52df53e22bfe367ce54c6c24
parentd3f46ce867559fe47e6ae589f0d03a1bb0ca7e21 (diff)
downloadchromium_src-0456654a270dda5e50a7ee8d58d7e7df07ac6c1c.zip
chromium_src-0456654a270dda5e50a7ee8d58d7e7df07ac6c1c.tar.gz
chromium_src-0456654a270dda5e50a7ee8d58d7e7df07ac6c1c.tar.bz2
Allow --app-list to be used in conjunction with --incognito for v1 apps.
BUG=177604 Review URL: https://chromiumcodereview.appspot.com/12380047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185825 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_impl.cc14
-rw-r--r--chrome/browser/ui/startup/startup_browser_creator_impl.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.cc b/chrome/browser/ui/startup/startup_browser_creator_impl.cc
index 14011cdd..cb90e20 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
diff --git a/chrome/browser/ui/startup/startup_browser_creator_impl.h b/chrome/browser/ui/startup/startup_browser_creator_impl.h
index 91c1edf..6b80ce9 100644
--- a/chrome/browser/ui/startup/startup_browser_creator_impl.h
+++ b/chrome/browser/ui/startup/startup_browser_creator_impl.h
@@ -85,7 +85,7 @@ class StartupBrowserCreatorImpl {
// If the process was launched with the web application command line flags,
// e.g. --app=http://www.google.com/ or --app_id=... return true.
// In this case |app_url| or |app_id| are populated if they're non-null.
- bool IsAppLaunch(Profile* profile, std::string* app_url, std::string* app_id);
+ bool IsAppLaunch(std::string* app_url, std::string* app_id);
// If IsAppLaunch is true, tries to open an application window.
// If the app is specified to start in a tab, or IsAppLaunch is false,