Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(466)

Unified Diff: athena/main/athena_main.cc

Issue 313733005: Introduces --app flag to athena to load an app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/shell/test/shell_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « apps/shell/test/shell_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698