Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: content/shell/browser/shell_content_browser_client.h

Issue 639293005: Content Shell: Introduce LayoutTestContentBrowserClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ 6 #define CONTENT_SHELL_BROWSER_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 "content/public/browser/content_browser_client.h" 13 #include "content/public/browser/content_browser_client.h"
14 #include "content/shell/browser/shell_speech_recognition_manager_delegate.h" 14 #include "content/shell/browser/shell_speech_recognition_manager_delegate.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 class ShellBrowserContext; 18 class ShellBrowserContext;
19 class ShellBrowserMainParts; 19 class ShellBrowserMainParts;
20 class ShellNotificationManager;
21 class ShellResourceDispatcherHostDelegate; 20 class ShellResourceDispatcherHostDelegate;
22 21
23 class ShellContentBrowserClient : public ContentBrowserClient { 22 class ShellContentBrowserClient : public ContentBrowserClient {
24 public: 23 public:
25 // Gets the current instance. 24 // Gets the current instance.
26 static ShellContentBrowserClient* Get(); 25 static ShellContentBrowserClient* Get();
27 26
28 static void SetSwapProcessesForRedirect(bool swap); 27 static void SetSwapProcessesForRedirect(bool swap);
29 28
30 ShellContentBrowserClient(); 29 ShellContentBrowserClient();
31 virtual ~ShellContentBrowserClient(); 30 virtual ~ShellContentBrowserClient();
32 31
33 // Will be lazily created when running layout tests.
34 ShellNotificationManager* GetShellNotificationManager();
35
36 // ContentBrowserClient overrides. 32 // ContentBrowserClient overrides.
37 virtual BrowserMainParts* CreateBrowserMainParts( 33 virtual BrowserMainParts* CreateBrowserMainParts(
38 const MainFunctionParams& parameters) override; 34 const MainFunctionParams& parameters) override;
39 virtual void RenderProcessWillLaunch(RenderProcessHost* host) override; 35 virtual void RenderProcessWillLaunch(RenderProcessHost* host) override;
40 virtual net::URLRequestContextGetter* CreateRequestContext( 36 virtual net::URLRequestContextGetter* CreateRequestContext(
41 BrowserContext* browser_context, 37 BrowserContext* browser_context,
42 ProtocolHandlerMap* protocol_handlers, 38 ProtocolHandlerMap* protocol_handlers,
43 URLRequestInterceptorScopedVector request_interceptors) override; 39 URLRequestInterceptorScopedVector request_interceptors) override;
44 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( 40 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
45 BrowserContext* browser_context, 41 BrowserContext* browser_context,
46 const base::FilePath& partition_path, 42 const base::FilePath& partition_path,
47 bool in_memory, 43 bool in_memory,
48 ProtocolHandlerMap* protocol_handlers, 44 ProtocolHandlerMap* protocol_handlers,
49 URLRequestInterceptorScopedVector request_interceptors) override; 45 URLRequestInterceptorScopedVector request_interceptors) override;
50 virtual bool IsHandledURL(const GURL& url) override; 46 virtual bool IsHandledURL(const GURL& url) override;
51 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, 47 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
52 int child_process_id) override; 48 int child_process_id) override;
53 virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host, 49 virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host,
54 const GURL& url, 50 const GURL& url,
55 WebPreferences* prefs) override; 51 WebPreferences* prefs) override;
56 virtual void ResourceDispatcherHostCreated() override; 52 virtual void ResourceDispatcherHostCreated() override;
57 virtual AccessTokenStore* CreateAccessTokenStore() override; 53 virtual AccessTokenStore* CreateAccessTokenStore() override;
58 virtual std::string GetDefaultDownloadName() override; 54 virtual std::string GetDefaultDownloadName() override;
59 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( 55 virtual WebContentsViewDelegate* GetWebContentsViewDelegate(
60 WebContents* web_contents) override; 56 WebContents* web_contents) override;
61 virtual QuotaPermissionContext* CreateQuotaPermissionContext() override; 57 virtual QuotaPermissionContext* CreateQuotaPermissionContext() override;
62 virtual void RequestDesktopNotificationPermission(
63 const GURL& source_origin,
64 RenderFrameHost* render_frame_host,
65 const base::Callback<void(blink::WebNotificationPermission)>& callback)
66 override;
67 virtual blink::WebNotificationPermission
68 CheckDesktopNotificationPermission(
69 const GURL& source_url,
70 ResourceContext* context,
71 int render_process_id) override;
72 virtual SpeechRecognitionManagerDelegate* 58 virtual SpeechRecognitionManagerDelegate*
73 GetSpeechRecognitionManagerDelegate() override; 59 GetSpeechRecognitionManagerDelegate() override;
74 virtual net::NetLog* GetNetLog() override; 60 virtual net::NetLog* GetNetLog() override;
75 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, 61 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context,
76 const GURL& current_url, 62 const GURL& current_url,
77 const GURL& new_url) override; 63 const GURL& new_url) override;
78 virtual DevToolsManagerDelegate* GetDevToolsManagerDelegate() override; 64 virtual DevToolsManagerDelegate* GetDevToolsManagerDelegate() override;
79 65
80 #if defined(OS_POSIX) && !defined(OS_MACOSX) 66 #if defined(OS_POSIX) && !defined(OS_MACOSX)
81 virtual void GetAdditionalMappedFilesForChildProcess( 67 virtual void GetAdditionalMappedFilesForChildProcess(
(...skipping 12 matching lines...) Expand all
94 return resource_dispatcher_host_delegate_.get(); 80 return resource_dispatcher_host_delegate_.get();
95 } 81 }
96 ShellBrowserMainParts* shell_browser_main_parts() { 82 ShellBrowserMainParts* shell_browser_main_parts() {
97 return shell_browser_main_parts_; 83 return shell_browser_main_parts_;
98 } 84 }
99 85
100 private: 86 private:
101 ShellBrowserContext* ShellBrowserContextForBrowserContext( 87 ShellBrowserContext* ShellBrowserContextForBrowserContext(
102 BrowserContext* content_browser_context); 88 BrowserContext* content_browser_context);
103 89
104 scoped_ptr<ShellNotificationManager> shell_notification_manager_;
105
106 scoped_ptr<ShellResourceDispatcherHostDelegate> 90 scoped_ptr<ShellResourceDispatcherHostDelegate>
107 resource_dispatcher_host_delegate_; 91 resource_dispatcher_host_delegate_;
108 92
109 base::FilePath webkit_source_dir_; 93 base::FilePath webkit_source_dir_;
110 94
111 ShellBrowserMainParts* shell_browser_main_parts_; 95 ShellBrowserMainParts* shell_browser_main_parts_;
112 }; 96 };
113 97
114 } // namespace content 98 } // namespace content
115 99
116 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ 100 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698