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