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 #ifndef EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ | 5 #ifndef EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ |
6 #define EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ | 6 #define EXTENSIONS_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 { | 12 namespace content { |
13 class BrowserContext; | 13 class BrowserContext; |
14 class ContentBrowserClient; | 14 class ContentBrowserClient; |
15 class ContentClient; | 15 class ContentClient; |
16 class ContentRendererClient; | 16 class ContentRendererClient; |
17 } | 17 } |
18 | 18 |
19 namespace extensions { | 19 namespace extensions { |
20 class ShellBrowserMainDelegate; | 20 class ShellBrowserMainDelegate; |
21 | 21 |
22 class ShellMainDelegate : public content::ContentMainDelegate { | 22 class ShellMainDelegate : public content::ContentMainDelegate { |
23 public: | 23 public: |
24 ShellMainDelegate(); | 24 ShellMainDelegate(); |
25 virtual ~ShellMainDelegate(); | 25 virtual ~ShellMainDelegate(); |
26 | 26 |
27 // ContentMainDelegate implementation: | 27 // ContentMainDelegate implementation: |
28 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; | 28 virtual bool BasicStartupComplete(int* exit_code) override; |
29 virtual void PreSandboxStartup() OVERRIDE; | 29 virtual void PreSandboxStartup() override; |
30 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; | 30 virtual content::ContentBrowserClient* CreateContentBrowserClient() override; |
31 virtual content::ContentRendererClient* CreateContentRendererClient() | 31 virtual content::ContentRendererClient* CreateContentRendererClient() |
32 OVERRIDE; | 32 override; |
33 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 33 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
34 virtual void ZygoteStarting( | 34 virtual void ZygoteStarting( |
35 ScopedVector<content::ZygoteForkDelegate>* delegates) OVERRIDE; | 35 ScopedVector<content::ZygoteForkDelegate>* delegates) override; |
36 #endif | 36 #endif |
37 | 37 |
38 protected: | 38 protected: |
39 // The created object is owned by this object. | 39 // The created object is owned by this object. |
40 virtual content::ContentClient* CreateContentClient(); | 40 virtual content::ContentClient* CreateContentClient(); |
41 virtual content::ContentBrowserClient* CreateShellContentBrowserClient(); | 41 virtual content::ContentBrowserClient* CreateShellContentBrowserClient(); |
42 virtual content::ContentRendererClient* CreateShellContentRendererClient(); | 42 virtual content::ContentRendererClient* CreateShellContentRendererClient(); |
43 | 43 |
44 // Initializes the resource bundle and resources.pak. | 44 // Initializes the resource bundle and resources.pak. |
45 virtual void InitializeResourceBundle(); | 45 virtual void InitializeResourceBundle(); |
46 | 46 |
47 private: | 47 private: |
48 // |process_type| is zygote, renderer, utility, etc. Returns true if the | 48 // |process_type| is zygote, renderer, utility, etc. Returns true if the |
49 // process needs data from resources.pak. | 49 // process needs data from resources.pak. |
50 static bool ProcessNeedsResourceBundle(const std::string& process_type); | 50 static bool ProcessNeedsResourceBundle(const std::string& process_type); |
51 | 51 |
52 scoped_ptr<content::ContentClient> content_client_; | 52 scoped_ptr<content::ContentClient> content_client_; |
53 scoped_ptr<content::ContentBrowserClient> browser_client_; | 53 scoped_ptr<content::ContentBrowserClient> browser_client_; |
54 scoped_ptr<content::ContentRendererClient> renderer_client_; | 54 scoped_ptr<content::ContentRendererClient> renderer_client_; |
55 | 55 |
56 DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); | 56 DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); |
57 }; | 57 }; |
58 | 58 |
59 } // namespace extensions | 59 } // namespace extensions |
60 | 60 |
61 #endif // EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ | 61 #endif // EXTENSIONS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ |
OLD | NEW |