| 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 #include "chromecast/shell/browser/cast_browser_context.h" | 5 #include "chromecast/shell/browser/cast_browser_context.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chromecast/common/cast_paths.h" | 10 #include "chromecast/common/cast_paths.h" |
| 11 #include "chromecast/shell/browser/url_request_context_factory.h" | 11 #include "chromecast/shell/browser/url_request_context_factory.h" |
| 12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
| 13 #include "content/public/browser/resource_context.h" | 13 #include "content/public/browser/resource_context.h" |
| 14 #include "content/public/browser/storage_partition.h" | 14 #include "content/public/browser/storage_partition.h" |
| 15 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 16 #include "net/url_request/url_request_context.h" | 16 #include "net/url_request/url_request_context.h" |
| 17 #include "net/url_request/url_request_context_getter.h" | 17 #include "net/url_request/url_request_context_getter.h" |
| 18 | 18 |
| 19 namespace chromecast { | 19 namespace chromecast { |
| 20 namespace shell { | 20 namespace shell { |
| 21 | 21 |
| 22 class CastBrowserContext::CastResourceContext : | 22 class CastBrowserContext::CastResourceContext : |
| 23 public content::ResourceContext { | 23 public content::ResourceContext { |
| 24 public: | 24 public: |
| 25 CastResourceContext(URLRequestContextFactory* url_request_context_factory) : | 25 explicit CastResourceContext( |
| 26 URLRequestContextFactory* url_request_context_factory) : |
| 26 url_request_context_factory_(url_request_context_factory) {} | 27 url_request_context_factory_(url_request_context_factory) {} |
| 27 virtual ~CastResourceContext() {} | 28 virtual ~CastResourceContext() {} |
| 28 | 29 |
| 29 // ResourceContext implementation: | 30 // ResourceContext implementation: |
| 30 virtual net::HostResolver* GetHostResolver() OVERRIDE { | 31 virtual net::HostResolver* GetHostResolver() OVERRIDE { |
| 31 return url_request_context_factory_->GetMainGetter()-> | 32 return url_request_context_factory_->GetMainGetter()-> |
| 32 GetURLRequestContext()->host_resolver(); | 33 GetURLRequestContext()->host_resolver(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 virtual net::URLRequestContext* GetRequestContext() OVERRIDE { | 36 virtual net::URLRequestContext* GetRequestContext() OVERRIDE { |
| 36 return url_request_context_factory_->GetMainGetter()-> | 37 return url_request_context_factory_->GetMainGetter()-> |
| 37 GetURLRequestContext(); | 38 GetURLRequestContext(); |
| 38 } | 39 } |
| 39 | 40 |
| 40 virtual bool AllowMicAccess(const GURL& origin) OVERRIDE { | |
| 41 return false; | |
| 42 } | |
| 43 | |
| 44 virtual bool AllowCameraAccess(const GURL& origin) OVERRIDE { | |
| 45 return false; | |
| 46 } | |
| 47 | |
| 48 private: | 41 private: |
| 49 URLRequestContextFactory* url_request_context_factory_; | 42 URLRequestContextFactory* url_request_context_factory_; |
| 50 | 43 |
| 51 DISALLOW_COPY_AND_ASSIGN(CastResourceContext); | 44 DISALLOW_COPY_AND_ASSIGN(CastResourceContext); |
| 52 }; | 45 }; |
| 53 | 46 |
| 54 CastBrowserContext::CastBrowserContext( | 47 CastBrowserContext::CastBrowserContext( |
| 55 URLRequestContextFactory* url_request_context_factory) | 48 URLRequestContextFactory* url_request_context_factory) |
| 56 : url_request_context_factory_(url_request_context_factory), | 49 : url_request_context_factory_(url_request_context_factory), |
| 57 resource_context_(new CastResourceContext(url_request_context_factory)) { | 50 resource_context_(new CastResourceContext(url_request_context_factory)) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return NULL; | 120 return NULL; |
| 128 } | 121 } |
| 129 | 122 |
| 130 content::SSLHostStateDelegate* CastBrowserContext::GetSSLHostStateDelegate() { | 123 content::SSLHostStateDelegate* CastBrowserContext::GetSSLHostStateDelegate() { |
| 131 NOTIMPLEMENTED(); | 124 NOTIMPLEMENTED(); |
| 132 return NULL; | 125 return NULL; |
| 133 } | 126 } |
| 134 | 127 |
| 135 } // namespace shell | 128 } // namespace shell |
| 136 } // namespace chromecast | 129 } // namespace chromecast |
| OLD | NEW |