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_APP_SHELL_MAIN_DELEGATE_H_ | 5 #ifndef APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ |
6 #define APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ | 6 #define APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/app/content_main_delegate.h" | 10 #include "content/public/app/content_main_delegate.h" |
11 | 11 |
| 12 namespace content { |
| 13 class BrowserContext; |
| 14 class ContentBrowserClient; |
| 15 class ContentClient; |
| 16 class ContentRendererClient; |
| 17 } |
| 18 |
12 namespace apps { | 19 namespace apps { |
13 | 20 class ShellBrowserMainDelegate; |
14 class ShellContentBrowserClient; | |
15 class ShellContentClient; | |
16 class ShellContentRendererClient; | |
17 | 21 |
18 class ShellMainDelegate : public content::ContentMainDelegate { | 22 class ShellMainDelegate : public content::ContentMainDelegate { |
19 public: | 23 public: |
20 ShellMainDelegate(); | 24 // |browser_main_delegate| is used only in the browser process. |
| 25 explicit ShellMainDelegate(ShellBrowserMainDelegate* browser_main_delegate); |
21 virtual ~ShellMainDelegate(); | 26 virtual ~ShellMainDelegate(); |
22 | 27 |
23 // ContentMainDelegate implementation: | 28 // ContentMainDelegate implementation: |
24 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; | 29 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; |
25 virtual void PreSandboxStartup() OVERRIDE; | 30 virtual void PreSandboxStartup() OVERRIDE; |
26 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; | 31 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; |
27 virtual content::ContentRendererClient* CreateContentRendererClient() | 32 virtual content::ContentRendererClient* CreateContentRendererClient() |
28 OVERRIDE; | 33 OVERRIDE; |
29 | 34 |
30 private: | 35 private: |
31 // |process_type| is zygote, renderer, utility, etc. Returns true if the | 36 // |process_type| is zygote, renderer, utility, etc. Returns true if the |
32 // process needs data from resources.pak. | 37 // process needs data from resources.pak. |
33 static bool ProcessNeedsResourceBundle(const std::string& process_type); | 38 static bool ProcessNeedsResourceBundle(const std::string& process_type); |
34 | 39 |
35 // Initializes the resource bundle and resources.pak. | 40 // Initializes the resource bundle and resources.pak. |
36 static void InitializeResourceBundle(); | 41 static void InitializeResourceBundle(); |
37 | 42 |
38 scoped_ptr<ShellContentClient> content_client_; | 43 scoped_ptr<content::ContentClient> content_client_; |
39 scoped_ptr<ShellContentBrowserClient> browser_client_; | 44 scoped_ptr<content::ContentBrowserClient> browser_client_; |
40 scoped_ptr<ShellContentRendererClient> renderer_client_; | 45 scoped_ptr<content::ContentRendererClient> renderer_client_; |
41 | 46 |
42 DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); | 47 DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); |
43 }; | 48 }; |
44 | 49 |
45 } // namespace apps | 50 } // namespace apps |
46 | 51 |
47 #endif // APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ | 52 #endif // APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ |
OLD | NEW |