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/main/athena_main_delegate.h" | 5 #include "athena/main/athena_main_delegate.h" |
6 | 6 |
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/main/athena_content_client.h" | 9 #include "athena/main/athena_content_client.h" |
10 #include "athena/main/athena_renderer_pdf_helper.h" | 10 #include "athena/main/athena_renderer_pdf_helper.h" |
11 #include "athena/main/public/athena_launcher.h" | 11 #include "athena/main/public/athena_launcher.h" |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
15 #include "components/pdf/renderer/ppb_pdf_impl.h" | 15 #include "components/pdf/renderer/ppb_pdf_impl.h" |
16 #include "content/public/app/content_main.h" | 16 #include "content/public/app/content_main.h" |
17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
18 #include "extensions/shell/browser/desktop_controller.h" | 18 #include "extensions/shell/browser/desktop_controller.h" |
19 #include "extensions/shell/browser/shell_browser_main_delegate.h" | 19 #include "extensions/shell/browser/shell_browser_main_delegate.h" |
20 #include "extensions/shell/browser/shell_content_browser_client.h" | 20 #include "extensions/shell/browser/shell_content_browser_client.h" |
21 #include "extensions/shell/browser/shell_extension_system.h" | 21 #include "extensions/shell/browser/shell_extension_system.h" |
22 #include "extensions/shell/common/shell_content_client.h" | 22 #include "extensions/shell/common/shell_content_client.h" |
23 #include "extensions/shell/common/switches.h" | 23 #include "extensions/shell/common/switches.h" |
24 #include "extensions/shell/renderer/shell_content_renderer_client.h" | 24 #include "extensions/shell/renderer/shell_content_renderer_client.h" |
25 #include "ppapi/c/private/ppb_pdf.h" | 25 #include "ppapi/c/private/ppb_pdf.h" |
| 26 #include "ui/aura/window.h" |
| 27 #include "ui/aura/window_tree_host.h" |
26 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
| 29 #include "ui/gfx/geometry/size.h" |
27 | 30 |
28 namespace athena { | 31 namespace athena { |
29 namespace { | 32 namespace { |
30 | 33 |
31 // We want to load the sample calculator app by default, for a while. Expecting | 34 // We want to load the sample calculator app by default, for a while. Expecting |
32 // to run athena_main at src/ | 35 // to run athena_main at src/ |
33 const char kDefaultAppPath[] = | 36 const char kDefaultAppPath[] = |
34 "chrome/common/extensions/docs/examples/apps/calculator/app"; | 37 "chrome/common/extensions/docs/examples/apps/calculator/app"; |
35 | 38 |
36 class AthenaDesktopController : public extensions::DesktopController { | 39 class AthenaDesktopController : public extensions::DesktopController { |
37 public: | 40 public: |
38 AthenaDesktopController() {} | 41 AthenaDesktopController() {} |
39 ~AthenaDesktopController() override {} | 42 ~AthenaDesktopController() override {} |
40 | 43 |
41 private: | 44 private: |
42 // extensions::DesktopController: | 45 // extensions::DesktopController: |
43 virtual aura::WindowTreeHost* GetHost() override { | 46 virtual gfx::Size GetWindowSize() override { |
44 return athena::AthenaEnv::Get()->GetHost(); | 47 return athena::AthenaEnv::Get()->GetHost()->window()->bounds().size(); |
45 } | 48 } |
46 | 49 |
47 // Creates a new app window and adds it to the desktop. The desktop maintains | 50 // Creates a new app window and adds it to the desktop. The desktop maintains |
48 // ownership of the window. | 51 // ownership of the window. |
49 // TODO(jamescook|oshima): Is this function needed? | 52 // TODO(jamescook|oshima): Is this function needed? |
50 virtual extensions::AppWindow* CreateAppWindow( | 53 virtual extensions::AppWindow* CreateAppWindow( |
51 content::BrowserContext* context, | 54 content::BrowserContext* context, |
52 const extensions::Extension* extension) override { | 55 const extensions::Extension* extension) override { |
53 NOTIMPLEMENTED(); | 56 NOTIMPLEMENTED(); |
54 return nullptr; | 57 return nullptr; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 169 |
167 void AthenaMainDelegate::InitializeResourceBundle() { | 170 void AthenaMainDelegate::InitializeResourceBundle() { |
168 base::FilePath pak_dir; | 171 base::FilePath pak_dir; |
169 PathService::Get(base::DIR_MODULE, &pak_dir); | 172 PathService::Get(base::DIR_MODULE, &pak_dir); |
170 base::FilePath pak_file = | 173 base::FilePath pak_file = |
171 pak_dir.Append(FILE_PATH_LITERAL("athena_resources.pak")); | 174 pak_dir.Append(FILE_PATH_LITERAL("athena_resources.pak")); |
172 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); | 175 ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); |
173 } | 176 } |
174 | 177 |
175 } // namespace athena | 178 } // namespace athena |
OLD | NEW |