OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "apps/shell/browser/shell_app_starter.h" | |
6 | |
7 #include "apps/shell/browser/shell_extension_system.h" | |
8 #include "base/bind.h" | |
9 #include "base/command_line.h" | |
10 #include "base/file_util.h" | |
11 #include "base/files/file_path.h" | |
12 | |
13 namespace apps { | |
14 namespace { | |
15 | |
16 void StartApp(content::BrowserContext* browser_context) { | |
17 const std::string kAppSwitch = "app"; | |
18 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
James Cook
2014/05/08 21:27:24
I know you just moved this code, but can you chang
oshima
2014/05/08 23:57:03
Done.
| |
19 if (command_line->HasSwitch(kAppSwitch)) { | |
20 base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); | |
21 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); | |
22 | |
23 extensions::ShellExtensionSystem* extension_system = | |
24 static_cast<extensions::ShellExtensionSystem*>( | |
25 extensions::ExtensionSystem::Get(browser_context)); | |
26 extension_system->LoadAndLaunchApp(app_absolute_dir); | |
27 } else { | |
28 LOG(ERROR) << "--" << kAppSwitch << " unset; boredom is in your future"; | |
29 } | |
30 } | |
31 | |
32 } // namespace | |
33 | |
34 StartCallback CreateDefaultStarter() { | |
35 return base::Bind(&StartApp); | |
36 } | |
37 | |
38 } // namespace apps | |
OLD | NEW |