OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
| 16 class ContentBrowserClient; |
| 17 class ContentPluginClient; |
| 18 class ContentRendererClient; |
| 19 class ContentUtilityClient; |
16 class ZygoteForkDelegate; | 20 class ZygoteForkDelegate; |
17 struct MainFunctionParams; | 21 struct MainFunctionParams; |
18 | 22 |
19 class CONTENT_EXPORT ContentMainDelegate { | 23 class CONTENT_EXPORT ContentMainDelegate { |
20 public: | 24 public: |
21 virtual ~ContentMainDelegate() {} | 25 virtual ~ContentMainDelegate() {} |
22 | 26 |
23 // Tells the embedder that the absolute basic startup has been done, i.e. | 27 // Tells the embedder that the absolute basic startup has been done, i.e. |
24 // it's now safe to create singletons and check the command line. Return true | 28 // it's now safe to create singletons and check the command line. Return true |
25 // if the process should exit afterwards, and if so, |exit_code| should be | 29 // if the process should exit afterwards, and if so, |exit_code| should be |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 virtual bool DelaySandboxInitialization(const std::string& process_type); | 65 virtual bool DelaySandboxInitialization(const std::string& process_type); |
62 | 66 |
63 #elif defined(OS_POSIX) && !defined(OS_ANDROID) | 67 #elif defined(OS_POSIX) && !defined(OS_ANDROID) |
64 // Tells the embedder that the zygote process is starting, and allows it to | 68 // Tells the embedder that the zygote process is starting, and allows it to |
65 // specify a zygote delegate if it wishes. | 69 // specify a zygote delegate if it wishes. |
66 virtual ZygoteForkDelegate* ZygoteStarting(); | 70 virtual ZygoteForkDelegate* ZygoteStarting(); |
67 | 71 |
68 // Called every time the zygote process forks. | 72 // Called every time the zygote process forks. |
69 virtual void ZygoteForked() {} | 73 virtual void ZygoteForked() {} |
70 #endif // OS_MACOSX | 74 #endif // OS_MACOSX |
| 75 |
| 76 protected: |
| 77 friend class ContentClientInitializer; |
| 78 |
| 79 // Called once per relevant process type to allow the embedder to customize |
| 80 // content. If an embedder wants the default (empty) implementation, don't |
| 81 // override this. |
| 82 virtual ContentBrowserClient* CreateContentBrowserClient(); |
| 83 virtual ContentPluginClient* CreateContentPluginClient(); |
| 84 virtual ContentRendererClient* CreateContentRendererClient(); |
| 85 virtual ContentUtilityClient* CreateContentUtilityClient(); |
71 }; | 86 }; |
72 | 87 |
73 } // namespace content | 88 } // namespace content |
74 | 89 |
75 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ | 90 #endif // CONTENT_PUBLIC_APP_CONTENT_MAIN_DELEGATE_H_ |
OLD | NEW |