Chromium Code Reviews| 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 "apps/shell/renderer/shell_renderer_main_delegate.h" | |
| 9 #include "athena/content/public/content_activity_factory.h" | 10 #include "athena/content/public/content_activity_factory.h" |
| 10 #include "athena/content/public/content_app_model_builder.h" | 11 #include "athena/content/public/content_app_model_builder.h" |
| 11 #include "athena/home/public/home_card.h" | 12 #include "athena/home/public/home_card.h" |
| 12 #include "athena/main/athena_launcher.h" | 13 #include "athena/main/athena_launcher.h" |
| 13 #include "athena/main/placeholder.h" | 14 #include "athena/main/placeholder.h" |
| 14 #include "athena/main/url_search_provider.h" | 15 #include "athena/main/url_search_provider.h" |
| 15 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 16 #include "base/file_util.h" | 17 #include "base/file_util.h" |
| 17 #include "content/public/app/content_main.h" | 18 #include "content/public/app/content_main.h" |
| 18 #include "ui/aura/window_tree_host.h" | 19 #include "ui/aura/window_tree_host.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { | 53 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { |
| 53 // TODO(mukai): create Athena's own ShellDesktopController subclass so that | 54 // TODO(mukai): create Athena's own ShellDesktopController subclass so that |
| 54 // it can initialize its own window manager logic. | 55 // it can initialize its own window manager logic. |
| 55 return new apps::ShellDesktopController(); | 56 return new apps::ShellDesktopController(); |
| 56 } | 57 } |
| 57 | 58 |
| 58 private: | 59 private: |
| 59 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 60 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
| 60 }; | 61 }; |
| 61 | 62 |
| 63 class AthenaRendererMainDelegate : public apps::ShellRendererMainDelegate { | |
| 64 public: | |
| 65 virtual ~AthenaRendererMainDelegate() {} | |
| 66 | |
| 67 private: | |
| 68 // apps::ShellRendererMainDelegate: | |
| 69 virtual void OnThreadStarted(content::RenderThread* thread) OVERRIDE {} | |
| 70 | |
| 71 virtual void OnViewCreated(content::RenderView* render_view) OVERRIDE {} | |
| 72 }; | |
|
James Cook
2014/06/17 17:40:22
DISALLOW_COPY_AND_ASSIGN?
sadrul
2014/06/17 20:37:39
Done.
| |
| 73 | |
| 62 class AthenaMainDelegate : public apps::ShellMainDelegate { | 74 class AthenaMainDelegate : public apps::ShellMainDelegate { |
| 63 public: | 75 public: |
| 64 AthenaMainDelegate() {} | 76 AthenaMainDelegate() {} |
| 65 virtual ~AthenaMainDelegate() {} | 77 virtual ~AthenaMainDelegate() {} |
| 66 | 78 |
| 67 private: | 79 private: |
| 68 // apps::ShellMainDelegate: | 80 // apps::ShellMainDelegate: |
| 69 virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate() | 81 virtual apps::ShellBrowserMainDelegate* CreateShellBrowserMainDelegate() |
| 70 OVERRIDE { | 82 OVERRIDE { |
| 71 return new AthenaBrowserMainDelegate(); | 83 return new AthenaBrowserMainDelegate(); |
| 72 } | 84 } |
| 73 | 85 |
| 86 virtual apps::ShellRendererMainDelegate* CreateShellRendererMainDelegate() | |
| 87 OVERRIDE { | |
| 88 return new AthenaRendererMainDelegate(); | |
|
James Cook
2014/06/17 17:40:22
Doesn't this leak?
sadrul
2014/06/17 20:37:39
It indeed does. I have clarified the ownership of
| |
| 89 } | |
| 90 | |
| 74 DISALLOW_COPY_AND_ASSIGN(AthenaMainDelegate); | 91 DISALLOW_COPY_AND_ASSIGN(AthenaMainDelegate); |
| 75 }; | 92 }; |
| 76 | 93 |
| 77 int main(int argc, const char** argv) { | 94 int main(int argc, const char** argv) { |
| 78 AthenaMainDelegate delegate; | 95 AthenaMainDelegate delegate; |
| 79 content::ContentMainParams params(&delegate); | 96 content::ContentMainParams params(&delegate); |
| 80 | 97 |
| 81 params.argc = argc; | 98 params.argc = argc; |
| 82 params.argv = argv; | 99 params.argv = argv; |
| 83 | 100 |
| 84 return content::ContentMain(params); | 101 return content::ContentMain(params); |
| 85 } | 102 } |
| OLD | NEW |