Move the ability to create BrowserContext to embedder

This commit is contained in:
Cheng Zhao 2016-07-12 21:39:54 +09:00
parent 400bb8d0f3
commit 00804e5f98
5 changed files with 22 additions and 17 deletions

View file

@ -18,8 +18,10 @@ class WebViewManager;
class AtomBrowserContext : public brightray::BrowserContext {
public:
AtomBrowserContext(const std::string& partition, bool in_memory);
~AtomBrowserContext() override;
// Get or create the BrowserContext according to its |partition| and
// |in_memory|.
static scoped_refptr<AtomBrowserContext> From(
const std::string& partition, bool in_memory);
void SetUserAgent(const std::string& user_agent);
@ -43,6 +45,10 @@ class AtomBrowserContext : public brightray::BrowserContext {
AtomNetworkDelegate* network_delegate() const { return network_delegate_; }
protected:
AtomBrowserContext(const std::string& partition, bool in_memory);
~AtomBrowserContext() override;
private:
std::unique_ptr<AtomDownloadManagerDelegate> download_manager_delegate_;
std::unique_ptr<WebViewManager> guest_manager_;