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

Unified Diff: apps/shell/app/shell_main.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
« no previous file with comments | « no previous file | apps/shell/app/shell_main_delegate.h » ('j') | apps/shell/common/shell_delegate.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/shell/app/shell_main.cc
diff --git a/apps/shell/app/shell_main.cc b/apps/shell/app/shell_main.cc
index cd44b99d7c9d504fb4263040e1d802753df97be2..4f6a055992fca141d0796f46fb634183e6cad6df 100644
--- a/apps/shell/app/shell_main.cc
+++ b/apps/shell/app/shell_main.cc
@@ -3,6 +3,12 @@
// found in the LICENSE file.
#include "apps/shell/app/shell_main_delegate.h"
+#include "apps/shell/browser/shell_browser_main_parts.h"
+#include "apps/shell/browser/shell_extension_system.h"
+#include "apps/shell/common/shell_delegate.h"
+#include "base/command_line.h"
+#include "base/file_util.h"
+#include "base/files/file_path.h"
#include "content/public/app/content_main.h"
#if defined(OS_WIN)
@@ -10,12 +16,38 @@
#include "sandbox/win/src/sandbox_types.h"
#endif
+class AppShellDelegate : public apps::ShellDelegate {
oshima 2014/05/07 22:08:03 I'm not sure where this code should live. Maybe in
James Cook 2014/05/07 23:42:45 The final code should live in apps/shell/browser,
oshima 2014/05/08 21:12:37 moved to apps/shell/browser/shell_app_starter.
+ public:
+ AppShellDelegate() {}
+ virtual ~AppShellDelegate() {}
+
+ virtual void Start(content::BrowserContext* browser_context) OVERRIDE {
+ 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);
+
+ extensions::ShellExtensionSystem* extension_system =
+ static_cast<extensions::ShellExtensionSystem*>(
+ extensions::ExtensionSystem::Get(browser_context));
oshima 2014/05/07 22:08:03 Not sure if this is right thing to do either....
James Cook 2014/05/07 23:42:45 The cast is fine. It's just convenient to put Loa
+ extension_system->LoadAndLaunchApp(app_absolute_dir);
+ } else {
+ LOG(ERROR) << "--" << kAppSwitch << " unset; boredom is in your future";
+ }
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AppShellDelegate);
+};
+
#if defined(OS_WIN)
int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) {
#else
int main(int argc, const char** argv) {
#endif
- apps::ShellMainDelegate delegate;
+ AppShellDelegate app_shell_delegate;
+ apps::ShellMainDelegate delegate(&app_shell_delegate);
content::ContentMainParams params(&delegate);
#if defined(OS_WIN)
« no previous file with comments | « no previous file | apps/shell/app/shell_main_delegate.h » ('j') | apps/shell/common/shell_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698