Move the ability to create BrowserContext to embedder

This commit is contained in:
Cheng Zhao 2016-07-12 21:39:23 +09:00
parent 240b5c42b4
commit 6413a4c516
2 changed files with 11 additions and 10 deletions

View file

@ -30,13 +30,14 @@ class BrowserContext : public base::RefCounted<BrowserContext>,
public content::BrowserContext,
public brightray::URLRequestContextGetter::Delegate {
public:
// Get or Create the BrowserContext according to its |partition| and |in_memory|.
static scoped_refptr<BrowserContext> From(
// Get the BrowserContext according to its |partition| and |in_memory|,
// empty pointer when be returned when there is no matching BrowserContext.
static scoped_refptr<BrowserContext> Get(
const std::string& partition, bool in_memory);
// Create a new BrowserContext, embedders should implement it on their own.
static scoped_refptr<BrowserContext> Create(
const std::string& partition, bool in_memory);
base::WeakPtr<BrowserContext> GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
// content::BrowserContext:
std::unique_ptr<content::ZoomLevelDelegate> CreateZoomLevelDelegate(