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

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

Issue 395883002: Support layout testing Web Notifications from Document and Worker contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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;
20 class ShellResourceDispatcherHostDelegate; 21 class ShellResourceDispatcherHostDelegate;
21 22
22 class ShellContentBrowserClient : public ContentBrowserClient { 23 class ShellContentBrowserClient : public ContentBrowserClient {
23 public: 24 public:
24 // Gets the current instance. 25 // Gets the current instance.
25 static ShellContentBrowserClient* Get(); 26 static ShellContentBrowserClient* Get();
26 27
27 static void SetSwapProcessesForRedirect(bool swap); 28 static void SetSwapProcessesForRedirect(bool swap);
28 29
29 ShellContentBrowserClient(); 30 ShellContentBrowserClient();
30 virtual ~ShellContentBrowserClient(); 31 virtual ~ShellContentBrowserClient();
31 32
33 // Will be lazily created when running layout tests.
34 ShellNotificationManager* GetShellNotificationManager();
35
32 // ContentBrowserClient overrides. 36 // ContentBrowserClient overrides.
33 virtual BrowserMainParts* CreateBrowserMainParts( 37 virtual BrowserMainParts* CreateBrowserMainParts(
34 const MainFunctionParams& parameters) OVERRIDE; 38 const MainFunctionParams& parameters) OVERRIDE;
35 virtual void RenderProcessWillLaunch(RenderProcessHost* host) OVERRIDE; 39 virtual void RenderProcessWillLaunch(RenderProcessHost* host) OVERRIDE;
36 virtual net::URLRequestContextGetter* CreateRequestContext( 40 virtual net::URLRequestContextGetter* CreateRequestContext(
37 BrowserContext* browser_context, 41 BrowserContext* browser_context,
38 ProtocolHandlerMap* protocol_handlers, 42 ProtocolHandlerMap* protocol_handlers,
39 URLRequestInterceptorScopedVector request_interceptors) OVERRIDE; 43 URLRequestInterceptorScopedVector request_interceptors) OVERRIDE;
40 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition( 44 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
41 BrowserContext* browser_context, 45 BrowserContext* browser_context,
42 const base::FilePath& partition_path, 46 const base::FilePath& partition_path,
43 bool in_memory, 47 bool in_memory,
44 ProtocolHandlerMap* protocol_handlers, 48 ProtocolHandlerMap* protocol_handlers,
45 URLRequestInterceptorScopedVector request_interceptors) OVERRIDE; 49 URLRequestInterceptorScopedVector request_interceptors) OVERRIDE;
46 virtual bool IsHandledURL(const GURL& url) OVERRIDE; 50 virtual bool IsHandledURL(const GURL& url) OVERRIDE;
47 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, 51 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
48 int child_process_id) OVERRIDE; 52 int child_process_id) OVERRIDE;
49 virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host, 53 virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host,
50 const GURL& url, 54 const GURL& url,
51 WebPreferences* prefs) OVERRIDE; 55 WebPreferences* prefs) OVERRIDE;
52 virtual void ResourceDispatcherHostCreated() OVERRIDE; 56 virtual void ResourceDispatcherHostCreated() OVERRIDE;
53 virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE; 57 virtual AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
54 virtual std::string GetDefaultDownloadName() OVERRIDE; 58 virtual std::string GetDefaultDownloadName() OVERRIDE;
55 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( 59 virtual WebContentsViewDelegate* GetWebContentsViewDelegate(
56 WebContents* web_contents) OVERRIDE; 60 WebContents* web_contents) OVERRIDE;
57 virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE; 61 virtual QuotaPermissionContext* CreateQuotaPermissionContext() OVERRIDE;
62 virtual void RequestDesktopNotificationPermission(
63 const GURL& source_origin,
64 RenderFrameHost* render_frame_host,
65 const base::Closure& callback) OVERRIDE;
66 virtual blink::WebNotificationPresenter::Permission
67 CheckDesktopNotificationPermission(
68 const GURL& source_url,
69 ResourceContext* context,
70 int render_process_id) OVERRIDE;
58 virtual SpeechRecognitionManagerDelegate* 71 virtual SpeechRecognitionManagerDelegate*
59 GetSpeechRecognitionManagerDelegate() OVERRIDE; 72 GetSpeechRecognitionManagerDelegate() OVERRIDE;
60 virtual net::NetLog* GetNetLog() OVERRIDE; 73 virtual net::NetLog* GetNetLog() OVERRIDE;
61 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, 74 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context,
62 const GURL& current_url, 75 const GURL& current_url,
63 const GURL& new_url) OVERRIDE; 76 const GURL& new_url) OVERRIDE;
64 77
65 #if defined(OS_POSIX) && !defined(OS_MACOSX) 78 #if defined(OS_POSIX) && !defined(OS_MACOSX)
66 virtual void GetAdditionalMappedFilesForChildProcess( 79 virtual void GetAdditionalMappedFilesForChildProcess(
67 const base::CommandLine& command_line, 80 const base::CommandLine& command_line,
(...skipping 11 matching lines...) Expand all
79 return resource_dispatcher_host_delegate_.get(); 92 return resource_dispatcher_host_delegate_.get();
80 } 93 }
81 ShellBrowserMainParts* shell_browser_main_parts() { 94 ShellBrowserMainParts* shell_browser_main_parts() {
82 return shell_browser_main_parts_; 95 return shell_browser_main_parts_;
83 } 96 }
84 97
85 private: 98 private:
86 ShellBrowserContext* ShellBrowserContextForBrowserContext( 99 ShellBrowserContext* ShellBrowserContextForBrowserContext(
87 BrowserContext* content_browser_context); 100 BrowserContext* content_browser_context);
88 101
102 scoped_ptr<ShellNotificationManager> shell_notification_manager_;
103
89 scoped_ptr<ShellResourceDispatcherHostDelegate> 104 scoped_ptr<ShellResourceDispatcherHostDelegate>
90 resource_dispatcher_host_delegate_; 105 resource_dispatcher_host_delegate_;
91 106
92 base::FilePath webkit_source_dir_; 107 base::FilePath webkit_source_dir_;
93 108
94 ShellBrowserMainParts* shell_browser_main_parts_; 109 ShellBrowserMainParts* shell_browser_main_parts_;
95 }; 110 };
96 111
97 } // namespace content 112 } // namespace content
98 113
99 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ 114 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698