OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ | 5 #ifndef EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ |
6 #define APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ | 6 #define EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "content/public/browser/browser_main_parts.h" | 11 #include "content/public/browser/browser_main_parts.h" |
12 #include "content/public/common/main_function_params.h" | 12 #include "content/public/common/main_function_params.h" |
13 #include "ui/aura/window_tree_host_observer.h" | 13 #include "ui/aura/window_tree_host_observer.h" |
14 | 14 |
15 namespace content { | 15 namespace content { |
16 class ShellDevToolsDelegate; | 16 class ShellDevToolsDelegate; |
17 struct MainFunctionParams; | 17 struct MainFunctionParams; |
18 } | 18 } |
19 | 19 |
20 namespace extensions { | |
21 class ShellExtensionsBrowserClient; | |
22 class ShellExtensionSystem; | |
23 class ShellOmahaQueryParamsDelegate; | |
24 } | |
25 | |
26 namespace views { | 20 namespace views { |
27 class Widget; | 21 class Widget; |
28 } | 22 } |
29 | 23 |
30 namespace net { | 24 namespace net { |
31 class NetLog; | 25 class NetLog; |
32 } | 26 } |
33 | 27 |
34 namespace apps { | 28 namespace extensions { |
35 | 29 |
36 class ShellBrowserContext; | 30 class ShellBrowserContext; |
37 class ShellBrowserMainDelegate; | 31 class ShellBrowserMainDelegate; |
38 class ShellDesktopController; | 32 class ShellDesktopController; |
| 33 class ShellExtensionsBrowserClient; |
39 class ShellExtensionsClient; | 34 class ShellExtensionsClient; |
| 35 class ShellExtensionSystem; |
| 36 class ShellOmahaQueryParamsDelegate; |
40 | 37 |
41 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
42 class ShellNetworkController; | 39 class ShellNetworkController; |
43 #endif | 40 #endif |
44 | 41 |
45 // Handles initialization of AppShell. | 42 // Handles initialization of AppShell. |
46 class ShellBrowserMainParts : public content::BrowserMainParts { | 43 class ShellBrowserMainParts : public content::BrowserMainParts { |
47 public: | 44 public: |
48 ShellBrowserMainParts(const content::MainFunctionParams& parameters, | 45 ShellBrowserMainParts(const content::MainFunctionParams& parameters, |
49 ShellBrowserMainDelegate* browser_main_delegate); | 46 ShellBrowserMainDelegate* browser_main_delegate); |
50 virtual ~ShellBrowserMainParts(); | 47 virtual ~ShellBrowserMainParts(); |
51 | 48 |
52 ShellBrowserContext* browser_context() { | 49 ShellBrowserContext* browser_context() { return browser_context_.get(); } |
53 return browser_context_.get(); | |
54 } | |
55 | 50 |
56 extensions::ShellExtensionSystem* extension_system() { | 51 ShellExtensionSystem* extension_system() { return extension_system_; } |
57 return extension_system_; | |
58 } | |
59 | 52 |
60 // BrowserMainParts overrides. | 53 // BrowserMainParts overrides. |
61 virtual void PreEarlyInitialization() OVERRIDE; | 54 virtual void PreEarlyInitialization() OVERRIDE; |
62 virtual void PreMainMessageLoopStart() OVERRIDE; | 55 virtual void PreMainMessageLoopStart() OVERRIDE; |
63 virtual void PostMainMessageLoopStart() OVERRIDE; | 56 virtual void PostMainMessageLoopStart() OVERRIDE; |
64 virtual int PreCreateThreads() OVERRIDE; | 57 virtual int PreCreateThreads() OVERRIDE; |
65 virtual void PreMainMessageLoopRun() OVERRIDE; | 58 virtual void PreMainMessageLoopRun() OVERRIDE; |
66 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; | 59 virtual bool MainMessageLoopRun(int* result_code) OVERRIDE; |
67 virtual void PostMainMessageLoopRun() OVERRIDE; | 60 virtual void PostMainMessageLoopRun() OVERRIDE; |
68 virtual void PostDestroyThreads() OVERRIDE; | 61 virtual void PostDestroyThreads() OVERRIDE; |
69 | 62 |
70 private: | 63 private: |
71 // Creates and initializes the ExtensionSystem. | 64 // Creates and initializes the ExtensionSystem. |
72 void CreateExtensionSystem(); | 65 void CreateExtensionSystem(); |
73 | 66 |
74 #if defined(OS_CHROMEOS) | 67 #if defined(OS_CHROMEOS) |
75 scoped_ptr<ShellNetworkController> network_controller_; | 68 scoped_ptr<ShellNetworkController> network_controller_; |
76 #endif | 69 #endif |
77 scoped_ptr<ShellDesktopController> desktop_controller_; | 70 scoped_ptr<ShellDesktopController> desktop_controller_; |
78 scoped_ptr<ShellBrowserContext> browser_context_; | 71 scoped_ptr<ShellBrowserContext> browser_context_; |
79 scoped_ptr<ShellExtensionsClient> extensions_client_; | 72 scoped_ptr<ShellExtensionsClient> extensions_client_; |
80 scoped_ptr<extensions::ShellExtensionsBrowserClient> | 73 scoped_ptr<ShellExtensionsBrowserClient> extensions_browser_client_; |
81 extensions_browser_client_; | |
82 scoped_ptr<net::NetLog> net_log_; | 74 scoped_ptr<net::NetLog> net_log_; |
83 scoped_ptr<content::ShellDevToolsDelegate> devtools_delegate_; | 75 scoped_ptr<content::ShellDevToolsDelegate> devtools_delegate_; |
84 scoped_ptr<extensions::ShellOmahaQueryParamsDelegate> | 76 scoped_ptr<ShellOmahaQueryParamsDelegate> omaha_query_params_delegate_; |
85 omaha_query_params_delegate_; | |
86 | 77 |
87 // Owned by the KeyedService system. | 78 // Owned by the KeyedService system. |
88 extensions::ShellExtensionSystem* extension_system_; | 79 ShellExtensionSystem* extension_system_; |
89 | 80 |
90 // For running app browsertests. | 81 // For running app browsertests. |
91 const content::MainFunctionParams parameters_; | 82 const content::MainFunctionParams parameters_; |
92 | 83 |
93 // If true, indicates the main message loop should be run | 84 // If true, indicates the main message loop should be run |
94 // in MainMessageLoopRun. If false, it has already been run. | 85 // in MainMessageLoopRun. If false, it has already been run. |
95 bool run_message_loop_; | 86 bool run_message_loop_; |
96 | 87 |
97 scoped_ptr<ShellBrowserMainDelegate> browser_main_delegate_; | 88 scoped_ptr<ShellBrowserMainDelegate> browser_main_delegate_; |
98 | 89 |
99 DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); | 90 DISALLOW_COPY_AND_ASSIGN(ShellBrowserMainParts); |
100 }; | 91 }; |
101 | 92 |
102 } // namespace apps | 93 } // namespace extensions |
103 | 94 |
104 #endif // APPS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ | 95 #endif // EXTENSIONS_SHELL_BROWSER_SHELL_BROWSER_MAIN_PARTS_H_ |
OLD | NEW |