Index: athena/main/athena_main.cc |
diff --git a/athena/main/athena_main.cc b/athena/main/athena_main.cc |
index 99f5fa0ae256098adc0cb3f90e6b386e16ac2ce7..e5ea09f377f2b88ca17921a507dda9bac7277708 100644 |
--- a/athena/main/athena_main.cc |
+++ b/athena/main/athena_main.cc |
@@ -5,13 +5,20 @@ |
#include "apps/shell/app/shell_main_delegate.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 "athena/content/public/content_activity_factory.h" |
#include "athena/main/athena_launcher.h" |
#include "athena/main/placeholder.h" |
+#include "base/command_line.h" |
+#include "base/file_util.h" |
#include "content/public/app/content_main.h" |
#include "ui/aura/window_tree_host.h" |
#include "ui/wm/core/visibility_controller.h" |
+namespace { |
+const std::string kAppSwitch = "app"; |
+} // namespace |
+ |
class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
public: |
AthenaBrowserMainDelegate() {} |
@@ -22,6 +29,15 @@ class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
athena::StartAthena( |
apps::ShellDesktopController::instance()->host()->window(), |
new athena::ContentActivityFactory()); |
+ 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(context)); |
+ extension_system->LoadApp(app_absolute_dir); |
+ } |
CreateTestPages(context); |
} |