| Index: headless/lib/browser/headless_browser_context.h
|
| diff --git a/chromecast/browser/cast_browser_context.h b/headless/lib/browser/headless_browser_context.h
|
| similarity index 57%
|
| copy from chromecast/browser/cast_browser_context.h
|
| copy to headless/lib/browser/headless_browser_context.h
|
| index 7d635f22c2fd121da4a02e0e0fa6f55f7bf133bb..41b72116522aba81c453ffc1ef224b0e0d3c4819 100644
|
| --- a/chromecast/browser/cast_browser_context.h
|
| +++ b/headless/lib/browser/headless_browser_context.h
|
| @@ -1,29 +1,24 @@
|
| -// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
|
| -#define CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
|
| +#ifndef HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_
|
| +#define HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_
|
|
|
| #include "base/files/file_path.h"
|
| -#include "base/macros.h"
|
| #include "content/public/browser/browser_context.h"
|
| #include "content/public/browser/content_browser_client.h"
|
| +#include "content/public/browser/resource_context.h"
|
| +#include "headless/lib/browser/headless_url_request_context_getter.h"
|
| +#include "headless/public/headless_browser.h"
|
|
|
| -namespace chromecast {
|
| -namespace shell {
|
| +namespace headless {
|
| +class HeadlessResourceContext;
|
|
|
| -class CastDownloadManagerDelegate;
|
| -class URLRequestContextFactory;
|
| -
|
| -// Chromecast does not currently support multiple profiles. So there is a
|
| -// single BrowserContext for all chromecast renderers.
|
| -// There is no support for PartitionStorage.
|
| -class CastBrowserContext : public content::BrowserContext {
|
| +class HeadlessBrowserContext : public content::BrowserContext {
|
| public:
|
| - explicit CastBrowserContext(
|
| - URLRequestContextFactory* url_request_context_factory);
|
| - ~CastBrowserContext() override;
|
| + explicit HeadlessBrowserContext(const HeadlessBrowser::Options& options);
|
| + ~HeadlessBrowserContext() override;
|
|
|
| // BrowserContext implementation:
|
| scoped_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(
|
| @@ -48,25 +43,25 @@ class CastBrowserContext : public content::BrowserContext {
|
| content::PermissionManager* GetPermissionManager() override;
|
| content::BackgroundSyncController* GetBackgroundSyncController() override;
|
|
|
| - net::URLRequestContextGetter* GetSystemRequestContext();
|
| + const HeadlessBrowser::Options& options() const { return options_; }
|
|
|
| - private:
|
| - class CastResourceContext;
|
| + // Configure the URL request context getter to be used for serving URL
|
| + // requests in this browser instance.
|
| + void SetURLRequestContextGetter(
|
| + scoped_refptr<net::URLRequestContextGetter> url_request_context_getter);
|
|
|
| - // Performs initialization of the CastBrowserContext while IO is still
|
| + private:
|
| + // Performs initialization of the HeadlessBrowserContext while IO is still
|
| // allowed on the current thread.
|
| void InitWhileIOAllowed();
|
|
|
| - URLRequestContextFactory* const url_request_context_factory_;
|
| base::FilePath path_;
|
| - scoped_ptr<CastResourceContext> resource_context_;
|
| - scoped_ptr<CastDownloadManagerDelegate> download_manager_delegate_;
|
| - scoped_ptr<content::PermissionManager> permission_manager_;
|
| + scoped_ptr<HeadlessResourceContext> resource_context_;
|
| + HeadlessBrowser::Options options_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(CastBrowserContext);
|
| + DISALLOW_COPY_AND_ASSIGN(HeadlessBrowserContext);
|
| };
|
|
|
| -} // namespace shell
|
| -} // namespace chromecast
|
| +} // namespace headless
|
|
|
| -#endif // CHROMECAST_BROWSER_CAST_BROWSER_CONTEXT_H_
|
| +#endif // HEADLESS_LIB_BROWSER_HEADLESS_BROWSER_CONTEXT_H_
|
|
|