Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(427)

Unified Diff: headless/lib/browser/headless_browser_context.h

Issue 1674263002: headless: Initial headless embedder API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fine, no console logging Mr. Presubmit. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/DEPS ('k') | headless/lib/browser/headless_browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « headless/lib/browser/DEPS ('k') | headless/lib/browser/headless_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698