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

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: another rebase Created 6 years, 4 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
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/browser/shell_content_browser_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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::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;
58 virtual SpeechRecognitionManagerDelegate* 72 virtual SpeechRecognitionManagerDelegate*
59 GetSpeechRecognitionManagerDelegate() OVERRIDE; 73 GetSpeechRecognitionManagerDelegate() OVERRIDE;
60 virtual net::NetLog* GetNetLog() OVERRIDE; 74 virtual net::NetLog* GetNetLog() OVERRIDE;
61 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, 75 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context,
62 const GURL& current_url, 76 const GURL& current_url,
63 const GURL& new_url) OVERRIDE; 77 const GURL& new_url) OVERRIDE;
64 78
65 #if defined(OS_POSIX) && !defined(OS_MACOSX) 79 #if defined(OS_POSIX) && !defined(OS_MACOSX)
66 virtual void GetAdditionalMappedFilesForChildProcess( 80 virtual void GetAdditionalMappedFilesForChildProcess(
67 const base::CommandLine& command_line, 81 const base::CommandLine& command_line,
(...skipping 11 matching lines...) Expand all
79 return resource_dispatcher_host_delegate_.get(); 93 return resource_dispatcher_host_delegate_.get();
80 } 94 }
81 ShellBrowserMainParts* shell_browser_main_parts() { 95 ShellBrowserMainParts* shell_browser_main_parts() {
82 return shell_browser_main_parts_; 96 return shell_browser_main_parts_;
83 } 97 }
84 98
85 private: 99 private:
86 ShellBrowserContext* ShellBrowserContextForBrowserContext( 100 ShellBrowserContext* ShellBrowserContextForBrowserContext(
87 BrowserContext* content_browser_context); 101 BrowserContext* content_browser_context);
88 102
103 scoped_ptr<ShellNotificationManager> shell_notification_manager_;
104
89 scoped_ptr<ShellResourceDispatcherHostDelegate> 105 scoped_ptr<ShellResourceDispatcherHostDelegate>
90 resource_dispatcher_host_delegate_; 106 resource_dispatcher_host_delegate_;
91 107
92 base::FilePath webkit_source_dir_; 108 base::FilePath webkit_source_dir_;
93 109
94 ShellBrowserMainParts* shell_browser_main_parts_; 110 ShellBrowserMainParts* shell_browser_main_parts_;
95 }; 111 };
96 112
97 } // namespace content 113 } // namespace content
98 114
99 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_ 115 #endif // CONTENT_SHELL_BROWSER_SHELL_CONTENT_BROWSER_CLIENT_H_
OLDNEW
« no previous file with comments | « content/shell/BUILD.gn ('k') | content/shell/browser/shell_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698