Chromium Code Reviews| Index: chrome/browser/ui/startup/startup_browser_creator.cc |
| diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc |
| index ca029f9c65880cf50435c1b06e2f9ea7a7d40da1..fb491d2e3c3a7e088a091a0b8d3b5495652383e9 100644 |
| --- a/chrome/browser/ui/startup/startup_browser_creator.cc |
| +++ b/chrome/browser/ui/startup/startup_browser_creator.cc |
| @@ -24,6 +24,7 @@ |
| #include "base/prefs/pref_service.h" |
| #include "base/strings/string_number_conversions.h" |
| #include "base/strings/string_split.h" |
| +#include "base/strings/string_tokenizer.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "base/threading/thread_restrictions.h" |
| #include "chrome/browser/app_mode/app_mode_utils.h" |
| @@ -63,6 +64,7 @@ |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/child_process_security_policy.h" |
| #include "content/public/browser/navigation_controller.h" |
| +#include "extensions/common/switches.h" |
| #include "net/base/net_util.h" |
| #if defined(USE_ASH) |
| @@ -609,7 +611,28 @@ bool StartupBrowserCreator::ProcessCmdLineImpl( |
| if (silent_launch) |
| return true; |
| - VLOG(2) << "ProcessCmdLineImpl: PLACE 4"; |
| + VLOG(2) << "ProcessCmdLineImpl: PLACE 4.A"; |
| + // Check for --load-app. |
|
Daniel Erat
2014/11/14 23:13:58
nit: update to --load-apps (or delete the comment,
Zachary Kuznia
2014/11/14 23:20:40
Done.
|
| + if (command_line.HasSwitch(extensions::switches::kLoadApps) && |
| + !IncognitoModePrefs::ShouldLaunchIncognito( |
| + command_line, last_used_profile->GetPrefs())) { |
| + CommandLine::StringType path_list = |
| + command_line.GetSwitchValueNative(extensions::switches::kLoadApps); |
| + |
| + base::StringTokenizerT<CommandLine::StringType, |
| + CommandLine::StringType::const_iterator> |
| + tokenizer(path_list, FILE_PATH_LITERAL(",")); |
| + |
| + while (tokenizer.GetNext()) { |
| + base::FilePath app_absolute_dir = |
| + base::MakeAbsoluteFilePath(base::FilePath(tokenizer.token())); |
| + |
| + if (!apps::AppLoadService::Get(last_used_profile)->Load(app_absolute_dir)) |
| + return false; |
| + } |
| + } |
| + |
| + VLOG(2) << "ProcessCmdLineImpl: PLACE 4.B"; |
| // Check for --load-and-launch-app. |
| if (command_line.HasSwitch(apps::kLoadAndLaunchApp) && |
| !IncognitoModePrefs::ShouldLaunchIncognito( |