OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
6 #define CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 6 #define CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/browser/content_browser_client.h" | 10 #include "content/public/browser/content_browser_client.h" |
11 | 11 |
12 namespace chromecast { | 12 namespace chromecast { |
13 namespace shell { | 13 namespace shell { |
14 | 14 |
15 class CastBrowserMainParts; | 15 class CastBrowserMainParts; |
16 class URLRequestContextFactory; | 16 class URLRequestContextFactory; |
17 | 17 |
18 class CastContentBrowserClient: public content::ContentBrowserClient { | 18 class CastContentBrowserClient: public content::ContentBrowserClient { |
19 public: | 19 public: |
20 CastContentBrowserClient(); | 20 CastContentBrowserClient(); |
21 virtual ~CastContentBrowserClient(); | 21 virtual ~CastContentBrowserClient(); |
22 | 22 |
23 // content::ContentBrowserClient implementation: | 23 // content::ContentBrowserClient implementation: |
24 virtual content::BrowserMainParts* CreateBrowserMainParts( | 24 virtual content::BrowserMainParts* CreateBrowserMainParts( |
25 const content::MainFunctionParams& parameters) OVERRIDE; | 25 const content::MainFunctionParams& parameters) override; |
26 virtual void RenderProcessWillLaunch( | 26 virtual void RenderProcessWillLaunch( |
27 content::RenderProcessHost* host) OVERRIDE; | 27 content::RenderProcessHost* host) override; |
28 virtual net::URLRequestContextGetter* CreateRequestContext( | 28 virtual net::URLRequestContextGetter* CreateRequestContext( |
29 content::BrowserContext* browser_context, | 29 content::BrowserContext* browser_context, |
30 content::ProtocolHandlerMap* protocol_handlers, | 30 content::ProtocolHandlerMap* protocol_handlers, |
31 content::URLRequestInterceptorScopedVector request_interceptors) | 31 content::URLRequestInterceptorScopedVector request_interceptors) |
32 OVERRIDE; | 32 override; |
33 virtual bool IsHandledURL(const GURL& url) OVERRIDE; | 33 virtual bool IsHandledURL(const GURL& url) override; |
34 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, | 34 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line, |
35 int child_process_id) OVERRIDE; | 35 int child_process_id) override; |
36 virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; | 36 virtual content::AccessTokenStore* CreateAccessTokenStore() override; |
37 virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host, | 37 virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host, |
38 const GURL& url, | 38 const GURL& url, |
39 content::WebPreferences* prefs) OVERRIDE; | 39 content::WebPreferences* prefs) override; |
40 virtual std::string GetApplicationLocale() OVERRIDE; | 40 virtual std::string GetApplicationLocale() override; |
41 virtual void AllowCertificateError( | 41 virtual void AllowCertificateError( |
42 int render_process_id, | 42 int render_process_id, |
43 int render_view_id, | 43 int render_view_id, |
44 int cert_error, | 44 int cert_error, |
45 const net::SSLInfo& ssl_info, | 45 const net::SSLInfo& ssl_info, |
46 const GURL& request_url, | 46 const GURL& request_url, |
47 content::ResourceType resource_type, | 47 content::ResourceType resource_type, |
48 bool overridable, | 48 bool overridable, |
49 bool strict_enforcement, | 49 bool strict_enforcement, |
50 bool expired_previous_decision, | 50 bool expired_previous_decision, |
51 const base::Callback<void(bool)>& callback, | 51 const base::Callback<void(bool)>& callback, |
52 content::CertificateRequestResultType* result) OVERRIDE; | 52 content::CertificateRequestResultType* result) override; |
53 virtual void SelectClientCertificate( | 53 virtual void SelectClientCertificate( |
54 int render_process_id, | 54 int render_process_id, |
55 int render_frame_id, | 55 int render_frame_id, |
56 const net::HttpNetworkSession* network_session, | 56 const net::HttpNetworkSession* network_session, |
57 net::SSLCertRequestInfo* cert_request_info, | 57 net::SSLCertRequestInfo* cert_request_info, |
58 const base::Callback<void(net::X509Certificate*)>& callback) OVERRIDE; | 58 const base::Callback<void(net::X509Certificate*)>& callback) override; |
59 virtual bool CanCreateWindow( | 59 virtual bool CanCreateWindow( |
60 const GURL& opener_url, | 60 const GURL& opener_url, |
61 const GURL& opener_top_level_frame_url, | 61 const GURL& opener_top_level_frame_url, |
62 const GURL& source_origin, | 62 const GURL& source_origin, |
63 WindowContainerType container_type, | 63 WindowContainerType container_type, |
64 const GURL& target_url, | 64 const GURL& target_url, |
65 const content::Referrer& referrer, | 65 const content::Referrer& referrer, |
66 WindowOpenDisposition disposition, | 66 WindowOpenDisposition disposition, |
67 const blink::WebWindowFeatures& features, | 67 const blink::WebWindowFeatures& features, |
68 bool user_gesture, | 68 bool user_gesture, |
69 bool opener_suppressed, | 69 bool opener_suppressed, |
70 content::ResourceContext* context, | 70 content::ResourceContext* context, |
71 int render_process_id, | 71 int render_process_id, |
72 int opener_id, | 72 int opener_id, |
73 bool* no_javascript_access) OVERRIDE; | 73 bool* no_javascript_access) override; |
74 virtual content::DevToolsManagerDelegate* | 74 virtual content::DevToolsManagerDelegate* |
75 GetDevToolsManagerDelegate() OVERRIDE; | 75 GetDevToolsManagerDelegate() override; |
76 virtual void GetAdditionalMappedFilesForChildProcess( | 76 virtual void GetAdditionalMappedFilesForChildProcess( |
77 const base::CommandLine& command_line, | 77 const base::CommandLine& command_line, |
78 int child_process_id, | 78 int child_process_id, |
79 content::FileDescriptorInfo* mappings) OVERRIDE; | 79 content::FileDescriptorInfo* mappings) override; |
80 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) | 80 #if defined(OS_ANDROID) && defined(VIDEO_HOLE) |
81 virtual content::ExternalVideoSurfaceContainer* | 81 virtual content::ExternalVideoSurfaceContainer* |
82 OverrideCreateExternalVideoSurfaceContainer( | 82 OverrideCreateExternalVideoSurfaceContainer( |
83 content::WebContents* web_contents) OVERRIDE; | 83 content::WebContents* web_contents) override; |
84 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) | 84 #endif // defined(OS_ANDROID) && defined(VIDEO_HOLE) |
85 | 85 |
86 private: | 86 private: |
87 net::X509Certificate* SelectClientCertificateOnIOThread( | 87 net::X509Certificate* SelectClientCertificateOnIOThread( |
88 GURL requesting_url); | 88 GURL requesting_url); |
89 | 89 |
90 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; | 90 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); | 92 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); |
93 }; | 93 }; |
94 | 94 |
95 } // namespace shell | 95 } // namespace shell |
96 } // namespace chromecast | 96 } // namespace chromecast |
97 | 97 |
98 #endif // CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 98 #endif // CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |