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 { | 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 apps { | 19 namespace apps { |
20 class ShellBrowserMainDelegate; | 20 class ShellBrowserMainDelegate; |
21 class ShellRendererMainDelegate; | |
21 | 22 |
22 class ShellMainDelegate : public content::ContentMainDelegate { | 23 class ShellMainDelegate : public content::ContentMainDelegate { |
23 public: | 24 public: |
24 ShellMainDelegate(); | 25 ShellMainDelegate(); |
25 virtual ~ShellMainDelegate(); | 26 virtual ~ShellMainDelegate(); |
26 | 27 |
27 // ContentMainDelegate implementation: | 28 // ContentMainDelegate implementation: |
28 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; | 29 virtual bool BasicStartupComplete(int* exit_code) OVERRIDE; |
29 virtual void PreSandboxStartup() OVERRIDE; | 30 virtual void PreSandboxStartup() OVERRIDE; |
30 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; | 31 virtual content::ContentBrowserClient* CreateContentBrowserClient() OVERRIDE; |
31 virtual content::ContentRendererClient* CreateContentRendererClient() | 32 virtual content::ContentRendererClient* CreateContentRendererClient() |
32 OVERRIDE; | 33 OVERRIDE; |
33 | 34 |
34 protected: | 35 protected: |
35 // The created object is owned by ShellBrowserMainParts. | 36 // The created object is owned by ShellBrowserMainParts. |
36 virtual ShellBrowserMainDelegate* CreateShellBrowserMainDelegate(); | 37 virtual ShellBrowserMainDelegate* CreateShellBrowserMainDelegate(); |
37 | 38 |
39 virtual ShellRendererMainDelegate* CreateShellRendererMainDelegate(); | |
James Cook
2014/06/17 17:40:22
Who owns this object?
sadrul
2014/06/17 20:37:38
Good catch. I have changed this to (1) return a sc
| |
40 | |
38 private: | 41 private: |
39 // |process_type| is zygote, renderer, utility, etc. Returns true if the | 42 // |process_type| is zygote, renderer, utility, etc. Returns true if the |
40 // process needs data from resources.pak. | 43 // process needs data from resources.pak. |
41 static bool ProcessNeedsResourceBundle(const std::string& process_type); | 44 static bool ProcessNeedsResourceBundle(const std::string& process_type); |
42 | 45 |
43 // Initializes the resource bundle and resources.pak. | 46 // Initializes the resource bundle and resources.pak. |
44 static void InitializeResourceBundle(); | 47 static void InitializeResourceBundle(); |
45 | 48 |
46 scoped_ptr<content::ContentClient> content_client_; | 49 scoped_ptr<content::ContentClient> content_client_; |
47 scoped_ptr<content::ContentBrowserClient> browser_client_; | 50 scoped_ptr<content::ContentBrowserClient> browser_client_; |
48 scoped_ptr<content::ContentRendererClient> renderer_client_; | 51 scoped_ptr<content::ContentRendererClient> renderer_client_; |
49 | 52 |
50 DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); | 53 DISALLOW_COPY_AND_ASSIGN(ShellMainDelegate); |
51 }; | 54 }; |
52 | 55 |
53 } // namespace apps | 56 } // namespace apps |
54 | 57 |
55 #endif // APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ | 58 #endif // APPS_SHELL_APP_SHELL_MAIN_DELEGATE_H_ |
OLD | NEW |