Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / chromecast / browser / cast_browser_context.h
bloba15e169546385646667c1a3953be6da36ed43fb6
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_BROWSER_CAST_BROWSER_CONTEXT_H_
6 #define CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
8 #include "base/files/file_path.h"
9 #include "base/macros.h"
10 #include "content/public/browser/browser_context.h"
11 #include "content/public/browser/content_browser_client.h"
13 namespace chromecast {
14 namespace shell {
16 class CastDownloadManagerDelegate;
17 class URLRequestContextFactory;
19 // Chromecast does not currently support multiple profiles. So there is a
20 // single BrowserContext for all chromecast renderers.
21 // There is no support for PartitionStorage.
22 class CastBrowserContext : public content::BrowserContext {
23 public:
24 explicit CastBrowserContext(
25 URLRequestContextFactory* url_request_context_factory);
26 virtual ~CastBrowserContext();
28 // BrowserContext implementation:
29 virtual scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
30 const base::FilePath& partition_path) override;
31 virtual base::FilePath GetPath() const override;
32 virtual bool IsOffTheRecord() const override;
33 virtual net::URLRequestContextGetter* GetRequestContext() override;
34 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
35 int renderer_child_id) override;
36 virtual net::URLRequestContextGetter* GetMediaRequestContext() override;
37 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
38 int renderer_child_id) override;
39 virtual net::URLRequestContextGetter*
40 GetMediaRequestContextForStoragePartition(
41 const base::FilePath& partition_path,
42 bool in_memory) override;
43 virtual content::ResourceContext* GetResourceContext() override;
44 virtual content::DownloadManagerDelegate*
45 GetDownloadManagerDelegate() override;
46 virtual content::BrowserPluginGuestManager* GetGuestManager() override;
47 virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
48 virtual content::PushMessagingService* GetPushMessagingService() override;
49 virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
51 private:
52 class CastResourceContext;
54 // Performs initialization of the CastBrowserContext while IO is still
55 // allowed on the current thread.
56 void InitWhileIOAllowed();
58 URLRequestContextFactory* const url_request_context_factory_;
59 base::FilePath path_;
60 scoped_ptr<CastResourceContext> resource_context_;
61 scoped_ptr<CastDownloadManagerDelegate> download_manager_delegate_;
63 DISALLOW_COPY_AND_ASSIGN(CastBrowserContext);
66 } // namespace shell
67 } // namespace chromecast
69 #endif // CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_