OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 5 #ifndef CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
6 #define CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 6 #define CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/stats_counters.h" | 10 #include "base/metrics/stats_counters.h" |
11 #include "chrome/common/chrome_content_client.h" | 11 #include "chrome/common/chrome_content_client.h" |
12 #include "content/public/app/content_main_delegate.h" | 12 #include "content/public/app/content_main_delegate.h" |
13 | 13 |
14 // Chrome implementation of ContentMainDelegate. | 14 // Chrome implementation of ContentMainDelegate. |
15 class ChromeMainDelegate : public content::ContentMainDelegate { | 15 class ChromeMainDelegate : public content::ContentMainDelegate { |
16 public: | 16 public: |
17 ChromeMainDelegate(); | 17 ChromeMainDelegate(); |
18 virtual ~ChromeMainDelegate(); | 18 virtual ~ChromeMainDelegate(); |
19 | 19 |
| 20 private: |
| 21 // content::ContentMainDelegate implementation: |
20 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; | 22 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; |
21 | |
22 #if defined(OS_MACOSX) | |
23 void InitMacCrashReporter(const CommandLine& command_line, | |
24 const std::string& process_type); | |
25 #endif // defined(OS_MACOSX) | |
26 | |
27 virtual void PreSandboxStartup() OVERRIDE; | 23 virtual void PreSandboxStartup() OVERRIDE; |
28 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; | 24 virtual void SandboxInitialized(const std::string& process_type) OVERRIDE; |
29 virtual int RunProcess( | 25 virtual int RunProcess( |
30 const std::string& process_type, | 26 const std::string& process_type, |
31 const content::MainFunctionParams& main_function_params) OVERRIDE; | 27 const content::MainFunctionParams& main_function_params) OVERRIDE; |
32 virtual void ProcessExiting(const std::string& process_type) OVERRIDE; | 28 virtual void ProcessExiting(const std::string& process_type) OVERRIDE; |
33 | |
34 #if defined(OS_MACOSX) | 29 #if defined(OS_MACOSX) |
35 virtual bool ProcessRegistersWithSystemProcess( | 30 virtual bool ProcessRegistersWithSystemProcess( |
36 const std::string& process_type) OVERRIDE; | 31 const std::string& process_type) OVERRIDE; |
37 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE; | 32 virtual bool ShouldSendMachPort(const std::string& process_type) OVERRIDE; |
38 virtual bool DelaySandboxInitialization( | 33 virtual bool DelaySandboxInitialization( |
39 const std::string& process_type) OVERRIDE; | 34 const std::string& process_type) OVERRIDE; |
40 #elif defined(OS_POSIX) | 35 #elif defined(OS_POSIX) |
41 virtual content::ZygoteForkDelegate* ZygoteStarting() OVERRIDE; | 36 virtual content::ZygoteForkDelegate* ZygoteStarting() OVERRIDE; |
42 virtual void ZygoteForked() OVERRIDE; | 37 virtual void ZygoteForked() OVERRIDE; |
43 #endif | 38 #endif |
| 39 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; |
| 40 virtual content::ContentPluginClient* CreateContentPluginClient() OVERRIDE; |
| 41 virtual content::ContentRendererClient* |
| 42 CreateContentRendererClient() OVERRIDE; |
| 43 virtual content::ContentUtilityClient* CreateContentUtilityClient() OVERRIDE; |
44 | 44 |
45 private: | 45 #if defined(OS_MACOSX) |
| 46 void InitMacCrashReporter(const CommandLine& command_line, |
| 47 const std::string& process_type); |
| 48 #endif // defined(OS_MACOSX) |
| 49 |
46 chrome::ChromeContentClient chrome_content_client_; | 50 chrome::ChromeContentClient chrome_content_client_; |
47 scoped_ptr<base::StatsScope<base::StatsCounterTimer> > startup_timer_; | 51 scoped_ptr<base::StatsScope<base::StatsCounterTimer> > startup_timer_; |
48 | 52 |
49 DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); | 53 DISALLOW_COPY_AND_ASSIGN(ChromeMainDelegate); |
50 }; | 54 }; |
51 | 55 |
52 #endif // CHROME_APP_CHROME_MAIN_DELEGATE_H_ | 56 #endif // CHROME_APP_CHROME_MAIN_DELEGATE_H_ |
OLD | NEW |