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

@ -190,14 +190,14 @@ void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
pref_registry->RegisterDictionaryPref(prefs::kDevToolsFileSystemPaths);
}
} // namespace atom
namespace brightray {
// static
scoped_refptr<BrowserContext> BrowserContext::Create(
scoped_refptr<AtomBrowserContext> AtomBrowserContext::From(
const std::string& partition, bool in_memory) {
return make_scoped_refptr(new atom::AtomBrowserContext(partition, in_memory));
auto browser_context = brightray::BrowserContext::Get(partition, in_memory);
if (browser_context)
return static_cast<AtomBrowserContext*>(browser_context.get());
return new AtomBrowserContext(partition, in_memory);
}
} // namespace brightray
} // namespace atom