| 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" | 20 #include "extensions/browser/app_window/app_window.h" |
| 21 #include "extensions/browser/app_window/apps_client.h" | 21 #include "extensions/browser/app_window/apps_client.h" |
| 22 #include "extensions/shell/app/shell_main_delegate.h" | 22 #include "extensions/shell/app/shell_main_delegate.h" |
| 23 #include "extensions/shell/browser/desktop_controller.h" | 23 #include "extensions/shell/browser/desktop_controller.h" |
| 24 #include "extensions/shell/browser/shell_app_delegate.h" | 24 #include "extensions/shell/browser/shell_app_delegate.h" |
| 25 #include "extensions/shell/browser/shell_app_window.h" | |
| 26 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 25 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
| 27 #include "extensions/shell/browser/shell_content_browser_client.h" | 26 #include "extensions/shell/browser/shell_content_browser_client.h" |
| 28 #include "extensions/shell/browser/shell_extension_system.h" | 27 #include "extensions/shell/browser/shell_extension_system.h" |
| 29 #include "extensions/shell/browser/shell_native_app_window.h" | 28 #include "extensions/shell/browser/shell_native_app_window.h" |
| 30 #include "extensions/shell/common/shell_content_client.h" | 29 #include "extensions/shell/common/shell_content_client.h" |
| 31 #include "extensions/shell/common/switches.h" | 30 #include "extensions/shell/common/switches.h" |
| 32 #include "extensions/shell/renderer/shell_content_renderer_client.h" | 31 #include "extensions/shell/renderer/shell_content_renderer_client.h" |
| 33 #include "ppapi/c/private/ppb_pdf.h" | 32 #include "ppapi/c/private/ppb_pdf.h" |
| 34 #include "ui/aura/window_tree_host.h" | 33 #include "ui/aura/window_tree_host.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 48 public: | 47 public: |
| 49 AthenaDesktopController() {} | 48 AthenaDesktopController() {} |
| 50 virtual ~AthenaDesktopController() {} | 49 virtual ~AthenaDesktopController() {} |
| 51 | 50 |
| 52 private: | 51 private: |
| 53 // extensions::DesktopController: | 52 // extensions::DesktopController: |
| 54 virtual aura::WindowTreeHost* GetHost() OVERRIDE { | 53 virtual aura::WindowTreeHost* GetHost() OVERRIDE { |
| 55 return athena::AthenaEnv::Get()->GetHost(); | 54 return athena::AthenaEnv::Get()->GetHost(); |
| 56 } | 55 } |
| 57 | 56 |
| 58 // Creates a new ShellAppWindow and adds it to the desktop. The desktop | |
| 59 // maintains ownership of the window. | |
| 60 virtual extensions::ShellAppWindow* CreateShellAppWindow( | |
| 61 content::BrowserContext* context, | |
| 62 const extensions::Extension* extension) OVERRIDE { | |
| 63 extensions::ShellAppWindow* app_window = new extensions::ShellAppWindow(); | |
| 64 app_window->Init(context, extension, gfx::Size(100, 100)); | |
| 65 athena::ActivityManager::Get()->AddActivity( | |
| 66 athena::ActivityFactory::Get()->CreateAppActivity(app_window, | |
| 67 extension->id())); | |
| 68 return app_window; | |
| 69 } | |
| 70 | |
| 71 // Creates a new app window and adds it to the desktop. The desktop maintains | 57 // Creates a new app window and adds it to the desktop. The desktop maintains |
| 72 // ownership of the window. | 58 // ownership of the window. |
| 59 // TODO(jamescook|oshima): Is this function needed? |
| 73 virtual extensions::AppWindow* CreateAppWindow( | 60 virtual extensions::AppWindow* CreateAppWindow( |
| 74 content::BrowserContext* context, | 61 content::BrowserContext* context, |
| 75 const extensions::Extension* extension) OVERRIDE { | 62 const extensions::Extension* extension) OVERRIDE { |
| 76 NOTIMPLEMENTED(); | 63 NOTIMPLEMENTED(); |
| 77 return NULL; | 64 return NULL; |
| 78 } | 65 } |
| 79 | 66 |
| 80 // Adds the window to the desktop. | 67 // Adds the window to the desktop. |
| 81 virtual void AddAppWindow(aura::Window* window) OVERRIDE { | 68 virtual void AddAppWindow(aura::Window* window) OVERRIDE { |
| 82 NOTIMPLEMENTED(); | 69 NOTIMPLEMENTED(); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 | 238 |
| 252 int main(int argc, const char** argv) { | 239 int main(int argc, const char** argv) { |
| 253 AthenaMainDelegate delegate; | 240 AthenaMainDelegate delegate; |
| 254 content::ContentMainParams params(&delegate); | 241 content::ContentMainParams params(&delegate); |
| 255 | 242 |
| 256 params.argc = argc; | 243 params.argc = argc; |
| 257 params.argv = argv; | 244 params.argv = argv; |
| 258 | 245 |
| 259 return content::ContentMain(params); | 246 return content::ContentMain(params); |
| 260 } | 247 } |
| OLD | NEW |