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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « apps/shell/test/shell_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "apps/shell/app/shell_main_delegate.h" 5 #include "apps/shell/app/shell_main_delegate.h"
6 #include "apps/shell/browser/shell_browser_main_delegate.h" 6 #include "apps/shell/browser/shell_browser_main_delegate.h"
7 #include "apps/shell/browser/shell_desktop_controller.h" 7 #include "apps/shell/browser/shell_desktop_controller.h"
8 #include "apps/shell/browser/shell_extension_system.h"
8 #include "athena/content/public/content_activity_factory.h" 9 #include "athena/content/public/content_activity_factory.h"
9 #include "athena/main/athena_launcher.h" 10 #include "athena/main/athena_launcher.h"
10 #include "athena/main/placeholder.h" 11 #include "athena/main/placeholder.h"
12 #include "base/command_line.h"
13 #include "base/file_util.h"
11 #include "content/public/app/content_main.h" 14 #include "content/public/app/content_main.h"
12 #include "ui/aura/window_tree_host.h" 15 #include "ui/aura/window_tree_host.h"
13 #include "ui/wm/core/visibility_controller.h" 16 #include "ui/wm/core/visibility_controller.h"
14 17
18 namespace {
19 const std::string kAppSwitch = "app";
20 } // namespace
21
15 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { 22 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate {
16 public: 23 public:
17 AthenaBrowserMainDelegate() {} 24 AthenaBrowserMainDelegate() {}
18 virtual ~AthenaBrowserMainDelegate() {} 25 virtual ~AthenaBrowserMainDelegate() {}
19 26
20 // apps::ShellBrowserMainDelegate: 27 // apps::ShellBrowserMainDelegate:
21 virtual void Start(content::BrowserContext* context) OVERRIDE { 28 virtual void Start(content::BrowserContext* context) OVERRIDE {
22 athena::StartAthena( 29 athena::StartAthena(
23 apps::ShellDesktopController::instance()->host()->window(), 30 apps::ShellDesktopController::instance()->host()->window(),
24 new athena::ContentActivityFactory()); 31 new athena::ContentActivityFactory());
32 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
33 if (command_line->HasSwitch(kAppSwitch)) {
34 base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch));
35 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir);
36 extensions::ShellExtensionSystem* extension_system =
37 static_cast<extensions::ShellExtensionSystem*>(
38 extensions::ExtensionSystem::Get(context));
39 extension_system->LoadApp(app_absolute_dir);
40 }
25 CreateTestPages(context); 41 CreateTestPages(context);
26 } 42 }
27 43
28 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); } 44 virtual void Shutdown() OVERRIDE { athena::ShutdownAthena(); }
29 45
30 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { 46 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE {
31 // TODO(mukai): create Athena's own ShellDesktopController subclass so that 47 // TODO(mukai): create Athena's own ShellDesktopController subclass so that
32 // it can initialize its own window manager logic. 48 // it can initialize its own window manager logic.
33 return new apps::ShellDesktopController(); 49 return new apps::ShellDesktopController();
34 } 50 }
(...skipping 19 matching lines...) Expand all
54 70
55 int main(int argc, const char** argv) { 71 int main(int argc, const char** argv) {
56 AthenaMainDelegate delegate; 72 AthenaMainDelegate delegate;
57 content::ContentMainParams params(&delegate); 73 content::ContentMainParams params(&delegate);
58 74
59 params.argc = argc; 75 params.argc = argc;
60 params.argv = argv; 76 params.argv = argv;
61 77
62 return content::ContentMain(params); 78 return content::ContentMain(params);
63 } 79 }
OLDNEW
« 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