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_BROWSER_CONTEXT_H_ | 5 #ifndef CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_ |
6 #define CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_ | 6 #define CHROMECAST_SHELL_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 virtual ~CastBrowserContext(); |
27 | 27 |
28 // BrowserContext implementation: | 28 // BrowserContext implementation: |
29 virtual base::FilePath GetPath() const OVERRIDE; | 29 virtual base::FilePath GetPath() const override; |
30 virtual bool IsOffTheRecord() const OVERRIDE; | 30 virtual bool IsOffTheRecord() const override; |
31 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; | 31 virtual net::URLRequestContextGetter* GetRequestContext() override; |
32 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( | 32 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( |
33 int renderer_child_id) OVERRIDE; | 33 int renderer_child_id) override; |
34 virtual net::URLRequestContextGetter* GetMediaRequestContext() OVERRIDE; | 34 virtual net::URLRequestContextGetter* GetMediaRequestContext() override; |
35 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( | 35 virtual net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( |
36 int renderer_child_id) OVERRIDE; | 36 int renderer_child_id) override; |
37 virtual net::URLRequestContextGetter* | 37 virtual net::URLRequestContextGetter* |
38 GetMediaRequestContextForStoragePartition( | 38 GetMediaRequestContextForStoragePartition( |
39 const base::FilePath& partition_path, | 39 const base::FilePath& partition_path, |
40 bool in_memory) OVERRIDE; | 40 bool in_memory) override; |
41 virtual content::ResourceContext* GetResourceContext() OVERRIDE; | 41 virtual content::ResourceContext* GetResourceContext() override; |
42 virtual content::DownloadManagerDelegate* | 42 virtual content::DownloadManagerDelegate* |
43 GetDownloadManagerDelegate() OVERRIDE; | 43 GetDownloadManagerDelegate() override; |
44 virtual content::BrowserPluginGuestManager* GetGuestManager() OVERRIDE; | 44 virtual content::BrowserPluginGuestManager* GetGuestManager() override; |
45 virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; | 45 virtual storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; |
46 virtual content::PushMessagingService* GetPushMessagingService() OVERRIDE; | 46 virtual content::PushMessagingService* GetPushMessagingService() override; |
47 virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() OVERRIDE; | 47 virtual content::SSLHostStateDelegate* GetSSLHostStateDelegate() override; |
48 | 48 |
49 private: | 49 private: |
50 class CastResourceContext; | 50 class CastResourceContext; |
51 | 51 |
52 // Performs initialization of the CastBrowserContext while IO is still | 52 // Performs initialization of the CastBrowserContext while IO is still |
53 // allowed on the current thread. | 53 // allowed on the current thread. |
54 void InitWhileIOAllowed(); | 54 void InitWhileIOAllowed(); |
55 | 55 |
56 URLRequestContextFactory* const url_request_context_factory_; | 56 URLRequestContextFactory* const url_request_context_factory_; |
57 base::FilePath path_; | 57 base::FilePath path_; |
58 scoped_ptr<CastResourceContext> resource_context_; | 58 scoped_ptr<CastResourceContext> resource_context_; |
59 scoped_ptr<CastDownloadManagerDelegate> download_manager_delegate_; | 59 scoped_ptr<CastDownloadManagerDelegate> download_manager_delegate_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(CastBrowserContext); | 61 DISALLOW_COPY_AND_ASSIGN(CastBrowserContext); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace shell | 64 } // namespace shell |
65 } // namespace chromecast | 65 } // namespace chromecast |
66 | 66 |
67 #endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_ | 67 #endif // CHROMECAST_SHELL_BROWSER_CAST_BROWSER_CONTEXT_H_ |
OLD | NEW |