Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / chromecast / shell / browser / cast_content_browser_client.h
blob98504e3581a7eb741ea6062854ff78095aa6d584
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
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
6 #define CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/public/browser/content_browser_client.h"
12 namespace chromecast {
13 namespace shell {
15 class CastBrowserMainParts;
16 class URLRequestContextFactory;
18 class CastContentBrowserClient: public content::ContentBrowserClient {
19 public:
20 CastContentBrowserClient();
21 virtual ~CastContentBrowserClient();
23 // content::ContentBrowserClient implementation:
24 virtual content::BrowserMainParts* CreateBrowserMainParts(
25 const content::MainFunctionParams& parameters) OVERRIDE;
26 virtual void RenderProcessWillLaunch(
27 content::RenderProcessHost* host) OVERRIDE;
28 virtual net::URLRequestContextGetter* CreateRequestContext(
29 content::BrowserContext* browser_context,
30 content::ProtocolHandlerMap* protocol_handlers,
31 content::URLRequestInterceptorScopedVector request_interceptors)
32 OVERRIDE;
33 virtual bool IsHandledURL(const GURL& url) OVERRIDE;
34 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line,
35 int child_process_id) OVERRIDE;
36 virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE;
37 virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
38 const GURL& url,
39 content::WebPreferences* prefs) OVERRIDE;
40 virtual std::string GetApplicationLocale() OVERRIDE;
41 virtual void AllowCertificateError(
42 int render_process_id,
43 int render_view_id,
44 int cert_error,
45 const net::SSLInfo& ssl_info,
46 const GURL& request_url,
47 content::ResourceType resource_type,
48 bool overridable,
49 bool strict_enforcement,
50 bool expired_previous_decision,
51 const base::Callback<void(bool)>& callback,
52 content::CertificateRequestResultType* result) OVERRIDE;
53 virtual bool CanCreateWindow(
54 const GURL& opener_url,
55 const GURL& opener_top_level_frame_url,
56 const GURL& source_origin,
57 WindowContainerType container_type,
58 const GURL& target_url,
59 const content::Referrer& referrer,
60 WindowOpenDisposition disposition,
61 const blink::WebWindowFeatures& features,
62 bool user_gesture,
63 bool opener_suppressed,
64 content::ResourceContext* context,
65 int render_process_id,
66 int opener_id,
67 bool* no_javascript_access) OVERRIDE;
68 virtual void GetAdditionalMappedFilesForChildProcess(
69 const base::CommandLine& command_line,
70 int child_process_id,
71 std::vector<content::FileDescriptorInfo>* mappings) OVERRIDE;
73 private:
74 // Note: BrowserMainLoop holds ownership of CastBrowserMainParts after it is
75 // created.
76 CastBrowserMainParts* shell_browser_main_parts_;
77 scoped_ptr<URLRequestContextFactory> url_request_context_factory_;
79 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient);
82 } // namespace shell
83 } // namespace chromecast
85 #endif // CHROMECAST_SHELL_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_