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_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ |
6 #define CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
14 #include "content/public/browser/content_browser_client.h" | 14 #include "content/public/browser/content_browser_client.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class ShellBrowserContext; | 20 class ShellBrowserContext; |
21 class ShellBrowserMainParts; | 21 class ShellBrowserMainParts; |
22 class ShellResourceDispatcherHostDelegate; | 22 class ShellResourceDispatcherHostDelegate; |
23 | 23 |
24 class ShellContentBrowserClient : public ContentBrowserClient, | 24 class ShellContentBrowserClient : public ContentBrowserClient, |
25 public NotificationObserver { | 25 public NotificationObserver { |
26 public: | 26 public: |
27 // Gets the current instance. | 27 // Gets the current instance. |
28 static ShellContentBrowserClient* Get(); | 28 static ShellContentBrowserClient* Get(); |
29 | 29 |
| 30 static void SetSwapProcessesForRedirect(bool swap); |
| 31 |
30 ShellContentBrowserClient(); | 32 ShellContentBrowserClient(); |
31 virtual ~ShellContentBrowserClient(); | 33 virtual ~ShellContentBrowserClient(); |
32 | 34 |
33 // ContentBrowserClient overrides. | 35 // ContentBrowserClient overrides. |
34 virtual BrowserMainParts* CreateBrowserMainParts( | 36 virtual BrowserMainParts* CreateBrowserMainParts( |
35 const MainFunctionParams& parameters) OVERRIDE; | 37 const MainFunctionParams& parameters) OVERRIDE; |
36 virtual void RenderProcessHostCreated(RenderProcessHost* host) OVERRIDE; | 38 virtual void RenderProcessHostCreated(RenderProcessHost* host) OVERRIDE; |
37 virtual net::URLRequestContextGetter* CreateRequestContext( | 39 virtual net::URLRequestContextGetter* CreateRequestContext( |
38 BrowserContext* browser_context, | 40 BrowserContext* browser_context, |
39 ProtocolHandlerMap* protocol_handlers) OVERRIDE; | 41 ProtocolHandlerMap* protocol_handlers) OVERRIDE; |
(...skipping 10 matching lines...) Expand all Loading... |
50 WebPreferences* prefs) OVERRIDE; | 52 WebPreferences* prefs) OVERRIDE; |
51 virtual void ResourceDispatcherHostCreated() OVERRIDE; | 53 virtual void ResourceDispatcherHostCreated() OVERRIDE; |
52 virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE; | 54 virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE; |
53 virtual std::string GetDefaultDownloadName() OVERRIDE; | 55 virtual std::string GetDefaultDownloadName() OVERRIDE; |
54 virtual bool SupportsBrowserPlugin(content::BrowserContext* browser_context, | 56 virtual bool SupportsBrowserPlugin(content::BrowserContext* browser_context, |
55 const GURL& url) OVERRIDE; | 57 const GURL& url) OVERRIDE; |
56 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( | 58 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( |
57 WebContents* web_contents) OVERRIDE; | 59 WebContents* web_contents) OVERRIDE; |
58 virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE; | 60 virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE; |
59 virtual net::NetLog* GetNetLog() OVERRIDE; | 61 virtual net::NetLog* GetNetLog() OVERRIDE; |
| 62 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, |
| 63 const GURL& current_url, |
| 64 const GURL& new_url) OVERRIDE; |
60 | 65 |
61 #if defined(OS_ANDROID) | 66 #if defined(OS_ANDROID) |
62 virtual void GetAdditionalMappedFilesForChildProcess( | 67 virtual void GetAdditionalMappedFilesForChildProcess( |
63 const CommandLine& command_line, | 68 const CommandLine& command_line, |
64 int child_process_id, | 69 int child_process_id, |
65 std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE; | 70 std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE; |
66 #endif | 71 #endif |
67 | 72 |
68 // NotificationObserver implementation. | 73 // NotificationObserver implementation. |
69 virtual void Observe(int type, | 74 virtual void Observe(int type, |
(...skipping 19 matching lines...) Expand all Loading... |
89 base::FilePath webkit_source_dir_; | 94 base::FilePath webkit_source_dir_; |
90 | 95 |
91 ShellBrowserMainParts* shell_browser_main_parts_; | 96 ShellBrowserMainParts* shell_browser_main_parts_; |
92 | 97 |
93 NotificationRegistrar registrar_; | 98 NotificationRegistrar registrar_; |
94 }; | 99 }; |
95 | 100 |
96 } // namespace content | 101 } // namespace content |
97 | 102 |
98 #endif // CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ | 103 #endif // CONTENT_SHELL_SHELL_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |