OLD | NEW |
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 "apps/shell/browser/shell_extension_system.h" |
9 #include "athena/content/public/content_activity_factory.h" | 9 #include "athena/content/public/content_activity_factory.h" |
| 10 #include "athena/content/public/content_app_model_builder.h" |
10 #include "athena/main/athena_launcher.h" | 11 #include "athena/main/athena_launcher.h" |
11 #include "athena/main/placeholder.h" | 12 #include "athena/main/placeholder.h" |
12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
13 #include "base/file_util.h" | 14 #include "base/file_util.h" |
14 #include "content/public/app/content_main.h" | 15 #include "content/public/app/content_main.h" |
15 #include "ui/aura/window_tree_host.h" | 16 #include "ui/aura/window_tree_host.h" |
16 #include "ui/wm/core/visibility_controller.h" | 17 #include "ui/wm/core/visibility_controller.h" |
17 | 18 |
18 namespace { | 19 namespace { |
19 const std::string kAppSwitch = "app"; | 20 const std::string kAppSwitch = "app"; |
20 } // namespace | 21 } // namespace |
21 | 22 |
22 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { | 23 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
23 public: | 24 public: |
24 AthenaBrowserMainDelegate() {} | 25 AthenaBrowserMainDelegate() {} |
25 virtual ~AthenaBrowserMainDelegate() {} | 26 virtual ~AthenaBrowserMainDelegate() {} |
26 | 27 |
27 // apps::ShellBrowserMainDelegate: | 28 // apps::ShellBrowserMainDelegate: |
28 virtual void Start(content::BrowserContext* context) OVERRIDE { | 29 virtual void Start(content::BrowserContext* context) OVERRIDE { |
29 athena::StartAthena( | 30 athena::StartAthena( |
30 apps::ShellDesktopController::instance()->host()->window(), | 31 apps::ShellDesktopController::instance()->host()->window(), |
31 new athena::ContentActivityFactory()); | 32 new athena::ContentActivityFactory(), |
| 33 new athena::ContentAppModelBuilder(context)); |
32 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 34 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
33 if (command_line->HasSwitch(kAppSwitch)) { | 35 if (command_line->HasSwitch(kAppSwitch)) { |
34 base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); | 36 base::FilePath app_dir(command_line->GetSwitchValueNative(kAppSwitch)); |
35 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); | 37 base::FilePath app_absolute_dir = base::MakeAbsoluteFilePath(app_dir); |
36 extensions::ShellExtensionSystem* extension_system = | 38 extensions::ShellExtensionSystem* extension_system = |
37 static_cast<extensions::ShellExtensionSystem*>( | 39 static_cast<extensions::ShellExtensionSystem*>( |
38 extensions::ExtensionSystem::Get(context)); | 40 extensions::ExtensionSystem::Get(context)); |
39 extension_system->LoadApp(app_absolute_dir); | 41 extension_system->LoadApp(app_absolute_dir); |
40 } | 42 } |
41 CreateTestPages(context); | 43 CreateTestPages(context); |
(...skipping 28 matching lines...) Expand all Loading... |
70 | 72 |
71 int main(int argc, const char** argv) { | 73 int main(int argc, const char** argv) { |
72 AthenaMainDelegate delegate; | 74 AthenaMainDelegate delegate; |
73 content::ContentMainParams params(&delegate); | 75 content::ContentMainParams params(&delegate); |
74 | 76 |
75 params.argc = argc; | 77 params.argc = argc; |
76 params.argv = argv; | 78 params.argv = argv; |
77 | 79 |
78 return content::ContentMain(params); | 80 return content::ContentMain(params); |
79 } | 81 } |
OLD | NEW |