Chromium Code Reviews| Index: apps/shell/browser/default_shell_browser_main_delegate.cc |
| diff --git a/apps/shell/browser/default_shell_browser_main_delegate.cc b/apps/shell/browser/default_shell_browser_main_delegate.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a9648a50890d469e2cd860c5c76b716a7e6dbf4f |
| --- /dev/null |
| +++ b/apps/shell/browser/default_shell_browser_main_delegate.cc |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "apps/shell/browser/default_shell_browser_main_delegate.h" |
| + |
| +#include "apps/shell/browser/shell_extension_system.h" |
| +#include "base/command_line.h" |
| +#include "base/file_util.h" |
| +#include "base/files/file_path.h" |
| + |
| +namespace apps { |
| +DefaultShellBrowserMainDelegate::DefaultShellBrowserMainDelegate() { |
|
James Cook
2014/05/09 15:56:00
nit: blank line above
oshima
2014/05/09 17:54:24
Done.
|
| +} |
| + |
| +DefaultShellBrowserMainDelegate::~DefaultShellBrowserMainDelegate() { |
| +} |
| + |
| +void DefaultShellBrowserMainDelegate::Start( |
| + content::BrowserContext* browser_context) { |
| + const std::string kAppSwitch = "app"; |
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| + if (command_line->HasSwitch(kAppSwitch)) { |
| + base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); |
| + base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); |
| + |
| + extensions::ShellExtensionSystem* extension_system = |
| + static_cast<extensions::ShellExtensionSystem*>( |
| + extensions::ExtensionSystem::Get(browser_context)); |
| + extension_system->LoadAndLaunchApp(app_absolute_dir); |
| + } else { |
| + LOG(ERROR) << "--" << kAppSwitch << " unset; boredom is in your future"; |
| + } |
| +} |
| + |
| +} // namespace apps |