| 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" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 virtual void AddAppWindow(aura::Window* window) OVERRIDE { | 68 virtual void AddAppWindow(aura::Window* window) OVERRIDE { |
| 69 NOTIMPLEMENTED(); | 69 NOTIMPLEMENTED(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Closes and destroys the app windows. | 72 // Closes and destroys the app windows. |
| 73 virtual void CloseAppWindows() OVERRIDE {} | 73 virtual void CloseAppWindows() OVERRIDE {} |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController); | 75 DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 class AthenaAppsClient : public extensions::AppsClient { | |
| 79 public: | |
| 80 AthenaAppsClient() {} | |
| 81 virtual ~AthenaAppsClient() {} | |
| 82 | |
| 83 // extensions::AppsClient: | |
| 84 virtual std::vector<content::BrowserContext*> | |
| 85 GetLoadedBrowserContexts() OVERRIDE { | |
| 86 NOTIMPLEMENTED(); | |
| 87 return std::vector<content::BrowserContext*>(); | |
| 88 } | |
| 89 | |
| 90 virtual extensions::AppWindow* CreateAppWindow( | |
| 91 content::BrowserContext* context, | |
| 92 const extensions::Extension* extension) OVERRIDE { | |
| 93 return new extensions::AppWindow( | |
| 94 context, new extensions::ShellAppDelegate, extension); | |
| 95 } | |
| 96 | |
| 97 virtual extensions::NativeAppWindow* CreateNativeAppWindow( | |
| 98 extensions::AppWindow* window, | |
| 99 const extensions::AppWindow::CreateParams& params) OVERRIDE { | |
| 100 athena::ActivityManager::Get()->AddActivity( | |
| 101 athena::ActivityFactory::Get()->CreateAppActivity(window, NULL)); | |
| 102 return new extensions::ShellNativeAppWindow(window, params); | |
| 103 } | |
| 104 | |
| 105 virtual void IncrementKeepAliveCount() OVERRIDE {} | |
| 106 | |
| 107 virtual void DecrementKeepAliveCount() OVERRIDE {} | |
| 108 | |
| 109 virtual void OpenDevToolsWindow(content::WebContents* web_contents, | |
| 110 const base::Closure& callback) OVERRIDE { | |
| 111 NOTIMPLEMENTED(); | |
| 112 } | |
| 113 | |
| 114 virtual bool IsCurrentChannelOlderThanDev() OVERRIDE { | |
| 115 return false; | |
| 116 } | |
| 117 | |
| 118 private: | |
| 119 DISALLOW_COPY_AND_ASSIGN(AthenaAppsClient); | |
| 120 }; | |
| 121 | |
| 122 class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { | 78 class AthenaBrowserMainDelegate : public extensions::ShellBrowserMainDelegate { |
| 123 public: | 79 public: |
| 124 AthenaBrowserMainDelegate() {} | 80 AthenaBrowserMainDelegate() {} |
| 125 virtual ~AthenaBrowserMainDelegate() {} | 81 virtual ~AthenaBrowserMainDelegate() {} |
| 126 | 82 |
| 127 // extensions::ShellBrowserMainDelegate: | 83 // extensions::ShellBrowserMainDelegate: |
| 128 virtual void Start(content::BrowserContext* context) OVERRIDE { | 84 virtual void Start(content::BrowserContext* context) OVERRIDE { |
| 129 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 85 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 130 | 86 |
| 131 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( | 87 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 152 | 108 |
| 153 virtual void Shutdown() OVERRIDE { | 109 virtual void Shutdown() OVERRIDE { |
| 154 athena::AthenaEnv::Get()->OnTerminating(); | 110 athena::AthenaEnv::Get()->OnTerminating(); |
| 155 athena::ShutdownAthena(); | 111 athena::ShutdownAthena(); |
| 156 } | 112 } |
| 157 | 113 |
| 158 virtual extensions::DesktopController* CreateDesktopController() OVERRIDE { | 114 virtual extensions::DesktopController* CreateDesktopController() OVERRIDE { |
| 159 return new AthenaDesktopController(); | 115 return new AthenaDesktopController(); |
| 160 } | 116 } |
| 161 | 117 |
| 162 virtual extensions::AppsClient* CreateAppsClient() OVERRIDE { | |
| 163 return new AthenaAppsClient(); | |
| 164 } | |
| 165 | |
| 166 private: | 118 private: |
| 167 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 119 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
| 168 }; | 120 }; |
| 169 | 121 |
| 170 class AthenaContentBrowserClient | 122 class AthenaContentBrowserClient |
| 171 : public extensions::ShellContentBrowserClient { | 123 : public extensions::ShellContentBrowserClient { |
| 172 public: | 124 public: |
| 173 AthenaContentBrowserClient() | 125 AthenaContentBrowserClient() |
| 174 : extensions::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) { | 126 : extensions::ShellContentBrowserClient(new AthenaBrowserMainDelegate()) { |
| 175 } | 127 } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 191 |
| 240 int main(int argc, const char** argv) { | 192 int main(int argc, const char** argv) { |
| 241 AthenaMainDelegate delegate; | 193 AthenaMainDelegate delegate; |
| 242 content::ContentMainParams params(&delegate); | 194 content::ContentMainParams params(&delegate); |
| 243 | 195 |
| 244 params.argc = argc; | 196 params.argc = argc; |
| 245 params.argv = argv; | 197 params.argv = argv; |
| 246 | 198 |
| 247 return content::ContentMain(params); | 199 return content::ContentMain(params); |
| 248 } | 200 } |
| OLD | NEW |