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..561c1a729aafc904cda3bfc6eaa16c9b278cebfc 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. |
| + if (command_line.HasSwitch(extensions::switches::kLoadApp) && |
| + !IncognitoModePrefs::ShouldLaunchIncognito( |
| + command_line, last_used_profile->GetPrefs())) { |
| + CommandLine::StringType path_list = |
| + command_line.GetSwitchValueNative(extensions::switches::kLoadApp); |
| + |
| + base::StringTokenizerT<CommandLine::StringType, |
| + CommandLine::StringType::const_iterator> |
| + tokenizer(path_list, FILE_PATH_LITERAL(",")); |
| + |
| + |
|
Daniel Erat
2014/11/14 22:41:00
nit: delete extra blank line
Zachary Kuznia
2014/11/14 23:04:17
Done.
|
| + while (tokenizer.GetNext()) { |
| + base::FilePath app_absolute_dir = |
| + base::MakeAbsoluteFilePath(base::FilePath(tokenizer.token())); |
| + |
| + apps::AppLoadService::Get(last_used_profile)->Load(app_absolute_dir); |
|
Daniel Erat
2014/11/14 22:41:00
should we crash if this fails (and/or check that t
Zachary Kuznia
2014/11/14 23:04:17
I'll change it to match the false return value use
|
| + } |
|
James Cook
2014/11/14 22:55:42
drive-by comment: So --load-app is going to have d
Zachary Kuznia
2014/11/14 23:11:32
Done.
|
| + } |
| + |
| + VLOG(2) << "ProcessCmdLineImpl: PLACE 4.B"; |
| // Check for --load-and-launch-app. |
| if (command_line.HasSwitch(apps::kLoadAndLaunchApp) && |
| !IncognitoModePrefs::ShouldLaunchIncognito( |