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

Unified Diff: apps/shell/browser/shell_app_starter.cc

Issue 270763002: Minimal athena shell main (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: apps/shell/browser/shell_app_starter.cc
diff --git a/apps/shell/browser/shell_app_starter.cc b/apps/shell/browser/shell_app_starter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ffa8c04f92b6a862b326e7726ca6094b304d2c3b
--- /dev/null
+++ b/apps/shell/browser/shell_app_starter.cc
@@ -0,0 +1,38 @@
+// 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/shell_app_starter.h"
+
+#include "apps/shell/browser/shell_extension_system.h"
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/file_util.h"
+#include "base/files/file_path.h"
+
+namespace apps {
+namespace {
+
+void StartApp(content::BrowserContext* browser_context) {
+ const std::string kAppSwitch = "app";
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
James Cook 2014/05/08 21:27:24 I know you just moved this code, but can you chang
oshima 2014/05/08 23:57:03 Done.
+ 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
+
+StartCallback CreateDefaultStarter() {
+ return base::Bind(&StartApp);
+}
+
+} // namespace apps

Powered by Google App Engine
This is Rietveld 408576698