Fix usages of global BrowserContext in App::ImportCertificate

This commit is contained in:
Cheng Zhao 2016-06-22 16:10:36 +09:00
parent 6b1df5838c
commit 6f9c4766fc

View file

@ -463,10 +463,11 @@ void App::DisableHardwareAcceleration(mate::Arguments* args) {
void App::ImportCertificate(
const base::DictionaryValue& options,
const net::CompletionCallback& callback) {
auto browser_context = AtomBrowserMainParts::Get()->browser_context();
auto browser_context = brightray::BrowserContext::From("", false);
if (!certificate_manager_model_) {
std::unique_ptr<base::DictionaryValue> copy = options.CreateDeepCopy();
CertificateManagerModel::Create(browser_context,
CertificateManagerModel::Create(
browser_context.get(),
base::Bind(&App::OnCertificateManagerModelCreated,
base::Unretained(this),
base::Passed(&copy),