Chromium Code Reviews| 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/default_shell_browser_main_delegate.h" | |
| 6 | |
| 7 #include "apps/shell/browser/shell_extension_system.h" | |
| 8 #include "base/command_line.h" | |
| 9 #include "base/file_util.h" | |
| 10 #include "base/files/file_path.h" | |
| 11 | |
| 12 namespace apps { | |
| 13 DefaultShellBrowserMainDelegate::DefaultShellBrowserMainDelegate() { | |
|
James Cook
2014/05/09 15:56:00
nit: blank line above
oshima
2014/05/09 17:54:24
Done.
| |
| 14 } | |
| 15 | |
| 16 DefaultShellBrowserMainDelegate::~DefaultShellBrowserMainDelegate() { | |
| 17 } | |
| 18 | |
| 19 void DefaultShellBrowserMainDelegate::Start( | |
| 20 content::BrowserContext* browser_context) { | |
| 21 const std::string kAppSwitch = "app"; | |
| 22 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 23 if (command_line->HasSwitch(kAppSwitch)) { | |
| 24 base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); | |
| 25 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); | |
| 26 | |
| 27 extensions::ShellExtensionSystem* extension_system = | |
| 28 static_cast<extensions::ShellExtensionSystem*>( | |
| 29 extensions::ExtensionSystem::Get(browser_context)); | |
| 30 extension_system->LoadAndLaunchApp(app_absolute_dir); | |
| 31 } else { | |
| 32 LOG(ERROR) << "--" << kAppSwitch << " unset; boredom is in your future"; | |
| 33 } | |
| 34 } | |
| 35 | |
| 36 } // namespace apps | |
| OLD | NEW |