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 "athena/activity/public/activity_factory.h" | 5 #include "athena/activity/public/activity_factory.h" |
6 #include "athena/activity/public/activity_manager.h" | 6 #include "athena/activity/public/activity_manager.h" |
7 #include "athena/content/public/web_contents_view_delegate_creator.h" | 7 #include "athena/content/public/web_contents_view_delegate_creator.h" |
8 #include "athena/env/public/athena_env.h" | 8 #include "athena/env/public/athena_env.h" |
9 #include "athena/extensions/public/extensions_delegate.h" | 9 #include "athena/extensions/public/extensions_delegate.h" |
10 #include "athena/main/athena_content_client.h" | 10 #include "athena/main/athena_content_client.h" |
11 #include "athena/main/athena_renderer_pdf_helper.h" | 11 #include "athena/main/athena_renderer_pdf_helper.h" |
12 #include "athena/main/public/athena_launcher.h" | 12 #include "athena/main/public/athena_launcher.h" |
13 #include "athena/screen/public/screen_manager.h" | 13 #include "athena/screen/public/screen_manager.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/files/file_util.h" | 15 #include "base/files/file_util.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "components/pdf/renderer/ppb_pdf_impl.h" | 17 #include "components/pdf/renderer/ppb_pdf_impl.h" |
18 #include "content/public/app/content_main.h" | 18 #include "content/public/app/content_main.h" |
19 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
20 #include "extensions/browser/app_window/app_window.h" | |
21 #include "extensions/browser/app_window/apps_client.h" | |
20 #include "extensions/shell/app/shell_main_delegate.h" | 22 #include "extensions/shell/app/shell_main_delegate.h" |
21 #include "extensions/shell/browser/desktop_controller.h" | 23 #include "extensions/shell/browser/desktop_controller.h" |
24 #include "extensions/shell/browser/shell_app_delegate.h" | |
22 #include "extensions/shell/browser/shell_app_window.h" | 25 #include "extensions/shell/browser/shell_app_window.h" |
23 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 26 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
24 #include "extensions/shell/browser/shell_content_browser_client.h" | 27 #include "extensions/shell/browser/shell_content_browser_client.h" |
25 #include "extensions/shell/browser/shell_extension_system.h" | 28 #include "extensions/shell/browser/shell_extension_system.h" |
29 #include "extensions/shell/browser/shell_native_app_window.h" | |
26 #include "extensions/shell/common/shell_content_client.h" | 30 #include "extensions/shell/common/shell_content_client.h" |
27 #include "extensions/shell/common/switches.h" | 31 #include "extensions/shell/common/switches.h" |
28 #include "extensions/shell/renderer/shell_content_renderer_client.h" | 32 #include "extensions/shell/renderer/shell_content_renderer_client.h" |
29 #include "ppapi/c/private/ppb_pdf.h" | 33 #include "ppapi/c/private/ppb_pdf.h" |
30 #include "ui/aura/window_tree_host.h" | 34 #include "ui/aura/window_tree_host.h" |
31 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
32 #include "ui/wm/core/visibility_controller.h" | 36 #include "ui/wm/core/visibility_controller.h" |
33 | 37 |
34 namespace { | 38 namespace { |
35 | 39 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
77 virtual void AddAppWindow(aura::Window* window) OVERRIDE { | 81 virtual void AddAppWindow(aura::Window* window) OVERRIDE { |
78 NOTIMPLEMENTED(); | 82 NOTIMPLEMENTED(); |
79 } | 83 } |
80 | 84 |
81 // Closes and destroys the app windows. | 85 // Closes and destroys the app windows. |
82 virtual void CloseAppWindows() OVERRIDE {} | 86 virtual void CloseAppWindows() OVERRIDE {} |
83 | 87 |
84 DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController); | 88 DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController); |
85 }; | 89 }; |
86 | 90 |
91 class AthenaAppsClient : public extensions::AppsClient { | |
92 public: | |
oshima
2014/09/10 16:11:16
// extensions::AppsClient:
hashimoto
2014/09/11 06:26:35
Done.
| |
93 virtual std::vector<content::BrowserContext*> | |
94 GetLoadedBrowserContexts() OVERRIDE { | |
95 NOTIMPLEMENTED(); | |
96 return std::vector<content::BrowserContext*>(); | |
97 } | |
98 | |
99 virtual extensions::AppWindow* CreateAppWindow( | |
100 content::BrowserContext* context, | |
101 const extensions::Extension* extension) OVERRIDE { | |
102 return new extensions::AppWindow( | |
103 context, new extensions::ShellAppDelegate, extension); | |
104 } | |
105 | |
106 virtual extensions::NativeAppWindow* CreateNativeAppWindow( | |
107 extensions::AppWindow* window, | |
108 const extensions::AppWindow::CreateParams& params) OVERRIDE { | |
109 athena::ActivityManager::Get()->AddActivity( | |
110 athena::ActivityFactory::Get()->CreateAppActivity(window)); | |
111 return new extensions::ShellNativeAppWindow(window, params); | |
oshima
2014/09/10 16:11:16
FYI: CreateAppActivity currently creates its own w
hashimoto
2014/09/11 06:26:35
Can't athena be satisfied with aura::Window* inste
| |
112 } | |
113 | |
114 virtual void IncrementKeepAliveCount() OVERRIDE {} | |
115 | |
116 virtual void DecrementKeepAliveCount() OVERRIDE {} | |
117 | |
118 virtual void OpenDevToolsWindow(content::WebContents* web_contents, | |
119 const base::Closure& callback) OVERRIDE { | |
120 NOTIMPLEMENTED(); | |
121 } | |
122 | |
123 virtual bool IsCurrentChannelOlderThanDev() OVERRIDE { | |
124 return false; | |
125 } | |
126 }; | |
oshima
2014/09/10 16:11:16
disallow_copy_and_assign
hashimoto
2014/09/11 06:26:35
Done.
| |
127 | |
87 class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { | 128 class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { |
88 public: | 129 public: |
89 AthenaBrowserMainDelegate() {} | 130 AthenaBrowserMainDelegate() {} |
90 virtual ~AthenaBrowserMainDelegate() {} | 131 virtual ~AthenaBrowserMainDelegate() {} |
91 | 132 |
92 // extensions::ShellBrowserMainDelegate: | 133 // extensions::ShellBrowserMainDelegate: |
93 virtual void Start(content::BrowserContext* context) OVERRIDE { | 134 virtual void Start(content::BrowserContext* context) OVERRIDE { |
94 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 135 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
95 | 136 |
96 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( | 137 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( |
(...skipping 18 matching lines...) Expand all Loading... | |
115 | 156 |
116 virtual void Shutdown() OVERRIDE { | 157 virtual void Shutdown() OVERRIDE { |
117 athena::AthenaEnv::Get()->OnTerminating(); | 158 athena::AthenaEnv::Get()->OnTerminating(); |
118 athena::ShutdownAthena(); | 159 athena::ShutdownAthena(); |
119 } | 160 } |
120 | 161 |
121 virtual extensions::DesktopController* CreateDesktopController() OVERRIDE { | 162 virtual extensions::DesktopController* CreateDesktopController() OVERRIDE { |
122 return new AthenaDesktopController(); | 163 return new AthenaDesktopController(); |
123 } | 164 } |
124 | 165 |
166 virtual extensions::AppsClient* CreateAppsClient() OVERRIDE { | |
167 return new AthenaAppsClient(); | |
168 } | |
169 | |
125 private: | 170 private: |
126 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 171 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
127 }; | 172 }; |
128 | 173 |
129 class AthenaContentBrowserClient | 174 class AthenaContentBrowserClient |
130 : public extensions::ShellContentBrowserClient { | 175 : public extensions::ShellContentBrowserClient { |
131 public: | 176 public: |
132 AthenaContentBrowserClient() | 177 AthenaContentBrowserClient() |
133 : extensions::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) { | 178 : extensions::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) { |
134 } | 179 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
198 | 243 |
199 int main(int argc, const char** argv) { | 244 int main(int argc, const char** argv) { |
200 AthenaMainDelegate delegate; | 245 AthenaMainDelegate delegate; |
201 content::ContentMainParams params(&delegate); | 246 content::ContentMainParams params(&delegate); |
202 | 247 |
203 params.argc = argc; | 248 params.argc = argc; |
204 params.argv = argv; | 249 params.argv = argv; |
205 | 250 |
206 return content::ContentMain(params); | 251 return content::ContentMain(params); |
207 } | 252 } |
OLD | NEW |