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_content_browser_client.h" | 7 #include "apps/shell/browser/shell_content_browser_client.h" |
8 #include "apps/shell/browser/shell_desktop_controller.h" | 8 #include "apps/shell/browser/shell_desktop_controller.h" |
9 #include "apps/shell/browser/shell_extension_system.h" | 9 #include "apps/shell/browser/shell_extension_system.h" |
10 #include "apps/shell/common/switches.h" | 10 #include "apps/shell/common/switches.h" |
11 #include "apps/shell/renderer/shell_renderer_main_delegate.h" | 11 #include "apps/shell/renderer/shell_renderer_main_delegate.h" |
12 #include "athena/content/public/content_activity_factory.h" | 12 #include "athena/content/public/content_activity_factory.h" |
13 #include "athena/content/public/content_app_model_builder.h" | 13 #include "athena/content/public/content_app_model_builder.h" |
14 #include "athena/home/public/home_card.h" | 14 #include "athena/home/public/home_card.h" |
15 #include "athena/main/athena_app_window_controller.h" | 15 #include "athena/main/athena_app_window_controller.h" |
16 #include "athena/main/athena_launcher.h" | 16 #include "athena/main/athena_launcher.h" |
17 #include "athena/main/debug/debug_window.h" | 17 #include "athena/main/debug/debug_window.h" |
18 #include "athena/main/placeholder.h" | 18 #include "athena/main/placeholder.h" |
19 #include "athena/main/url_search_provider.h" | 19 #include "athena/main/url_search_provider.h" |
20 #include "athena/screen/public/screen_manager.h" | |
20 #include "athena/virtual_keyboard/public/virtual_keyboard_bindings.h" | 21 #include "athena/virtual_keyboard/public/virtual_keyboard_bindings.h" |
21 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" | 22 #include "athena/virtual_keyboard/public/virtual_keyboard_manager.h" |
22 #include "base/command_line.h" | 23 #include "base/command_line.h" |
23 #include "base/file_util.h" | 24 #include "base/file_util.h" |
24 #include "base/path_service.h" | 25 #include "base/path_service.h" |
25 #include "content/public/app/content_main.h" | 26 #include "content/public/app/content_main.h" |
26 #include "ui/aura/window_tree_host.h" | 27 #include "ui/aura/window_tree_host.h" |
27 #include "ui/base/resource/resource_bundle.h" | 28 #include "ui/base/resource/resource_bundle.h" |
28 #include "ui/keyboard/keyboard_controller.h" | 29 #include "ui/keyboard/keyboard_controller.h" |
29 #include "ui/keyboard/keyboard_controller_observer.h" | 30 #include "ui/keyboard/keyboard_controller_observer.h" |
(...skipping 21 matching lines...) Expand all Loading... | |
51 } | 52 } |
52 | 53 |
53 private: | 54 private: |
54 virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE { | 55 virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE { |
55 athena::HomeCard::Get()->UpdateVirtualKeyboardBounds(new_bounds); | 56 athena::HomeCard::Get()->UpdateVirtualKeyboardBounds(new_bounds); |
56 } | 57 } |
57 | 58 |
58 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardObserver); | 59 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardObserver); |
59 }; | 60 }; |
60 | 61 |
62 class AthenaDesktopController : public apps::ShellDesktopController { | |
63 public: | |
64 AthenaDesktopController() {} | |
65 virtual ~AthenaDesktopController() {} | |
66 | |
67 private: | |
68 // apps::ShellDesktopController: | |
69 virtual wm::FocusRules* CreateFocusRules() OVERRIDE { | |
70 return athena::ScreenManager::CreateFocusRules(); | |
71 } | |
72 DISALLOW_COPY_AND_ASSIGN(AthenaDesktopController); | |
James Cook
2014/07/18 02:39:51
nit: blank line above
oshima
2014/07/18 04:03:52
Done.
| |
73 }; | |
74 | |
61 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { | 75 class AthenaBrowserMainDelegate : public apps::ShellBrowserMainDelegate { |
62 public: | 76 public: |
63 AthenaBrowserMainDelegate() {} | 77 AthenaBrowserMainDelegate() {} |
64 virtual ~AthenaBrowserMainDelegate() {} | 78 virtual ~AthenaBrowserMainDelegate() {} |
65 | 79 |
66 // apps::ShellBrowserMainDelegate: | 80 // apps::ShellBrowserMainDelegate: |
67 virtual void Start(content::BrowserContext* context) OVERRIDE { | 81 virtual void Start(content::BrowserContext* context) OVERRIDE { |
68 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 82 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
69 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( | 83 base::FilePath app_dir = base::FilePath::FromUTF8Unsafe( |
70 command_line->HasSwitch(apps::switches::kAppShellAppPath) ? | 84 command_line->HasSwitch(apps::switches::kAppShellAppPath) ? |
(...skipping 22 matching lines...) Expand all Loading... | |
93 } | 107 } |
94 | 108 |
95 virtual void Shutdown() OVERRIDE { | 109 virtual void Shutdown() OVERRIDE { |
96 keyboard_observer_.reset(); | 110 keyboard_observer_.reset(); |
97 athena::ShutdownAthena(); | 111 athena::ShutdownAthena(); |
98 } | 112 } |
99 | 113 |
100 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { | 114 virtual apps::ShellDesktopController* CreateDesktopController() OVERRIDE { |
101 // TODO(mukai): create Athena's own ShellDesktopController subclass so that | 115 // TODO(mukai): create Athena's own ShellDesktopController subclass so that |
102 // it can initialize its own window manager logic. | 116 // it can initialize its own window manager logic. |
103 apps::ShellDesktopController* desktop = new apps::ShellDesktopController(); | 117 apps::ShellDesktopController* desktop = new AthenaDesktopController(); |
104 desktop->SetAppWindowController(new athena::AthenaAppWindowController()); | 118 desktop->SetAppWindowController(new athena::AthenaAppWindowController()); |
105 return desktop; | 119 return desktop; |
106 } | 120 } |
107 | 121 |
108 private: | 122 private: |
109 scoped_ptr<VirtualKeyboardObserver> keyboard_observer_; | 123 scoped_ptr<VirtualKeyboardObserver> keyboard_observer_; |
110 | 124 |
111 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); | 125 DISALLOW_COPY_AND_ASSIGN(AthenaBrowserMainDelegate); |
112 }; | 126 }; |
113 | 127 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 | 189 |
176 int main(int argc, const char** argv) { | 190 int main(int argc, const char** argv) { |
177 AthenaMainDelegate delegate; | 191 AthenaMainDelegate delegate; |
178 content::ContentMainParams params(&delegate); | 192 content::ContentMainParams params(&delegate); |
179 | 193 |
180 params.argc = argc; | 194 params.argc = argc; |
181 params.argv = argv; | 195 params.argv = argv; |
182 | 196 |
183 return content::ContentMain(params); | 197 return content::ContentMain(params); |
184 } | 198 } |
OLD | NEW |