Index: apps/shell/browser/shell_browser_main_parts.cc |
diff --git a/apps/shell/browser/shell_browser_main_parts.cc b/apps/shell/browser/shell_browser_main_parts.cc |
index be1c82dc4d7ff153472becd2d2ce0649d92276bb..126f86ab623637ec146089c1c231049a98a7b4d7 100644 |
--- a/apps/shell/browser/shell_browser_main_parts.cc |
+++ b/apps/shell/browser/shell_browser_main_parts.cc |
@@ -5,14 +5,12 @@ |
#include "apps/shell/browser/shell_browser_main_parts.h" |
#include "apps/shell/browser/shell_browser_context.h" |
+#include "apps/shell/browser/shell_browser_main_delegate.h" |
#include "apps/shell/browser/shell_desktop_controller.h" |
#include "apps/shell/browser/shell_extension_system.h" |
#include "apps/shell/browser/shell_extension_system_factory.h" |
#include "apps/shell/browser/shell_extensions_browser_client.h" |
#include "apps/shell/common/shell_extensions_client.h" |
-#include "base/command_line.h" |
-#include "base/file_util.h" |
-#include "base/files/file_path.h" |
#include "base/run_loop.h" |
#include "components/keyed_service/content/browser_context_dependency_manager.h" |
#include "content/public/common/result_codes.h" |
@@ -47,10 +45,13 @@ void EnsureBrowserContextKeyedServiceFactoriesBuilt() { |
namespace apps { |
ShellBrowserMainParts::ShellBrowserMainParts( |
- const content::MainFunctionParams& parameters) |
+ const content::MainFunctionParams& parameters, |
+ ShellBrowserMainDelegate* browser_main_delegate) |
: extension_system_(NULL), |
parameters_(parameters), |
- run_message_loop_(true) {} |
+ run_message_loop_(true), |
+ browser_main_delegate_(browser_main_delegate) { |
+} |
ShellBrowserMainParts::~ShellBrowserMainParts() { |
} |
@@ -105,20 +106,13 @@ void ShellBrowserMainParts::PreMainMessageLoopRun() { |
devtools_delegate_.reset( |
new content::ShellDevToolsDelegate(browser_context_.get())); |
- |
- const std::string kAppSwitch = "app"; |
- CommandLine* command_line = CommandLine::ForCurrentProcess(); |
- if (command_line->HasSwitch(kAppSwitch)) { |
- base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); |
- base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); |
- extension_system_->LoadAndLaunchApp(app_absolute_dir); |
- } else if (parameters_.ui_task) { |
+ if (parameters_.ui_task) { |
// For running browser tests. |
parameters_.ui_task->Run(); |
delete parameters_.ui_task; |
run_message_loop_ = false; |
} else { |
- LOG(ERROR) << "--" << kAppSwitch << " unset; boredom is in your future"; |
+ browser_main_delegate_->Start(browser_context_.get()); |
} |
} |