Merge pull request #3120 from atom/ntlm-part-two

Optionally allow NTLM authentication for all domains
This commit is contained in:
Cheng Zhao 2015-10-20 13:48:12 +08:00
commit 370cb5b5e1
4 changed files with 30 additions and 1 deletions

View file

@ -251,6 +251,12 @@ void App::SetAppUserModelId(const std::string& app_id) {
#endif
}
void App::AllowNTLMCredentialsForAllDomains(bool should_allow) {
auto browser_context = static_cast<AtomBrowserContext*>(
AtomBrowserMainParts::Get()->browser_context());
browser_context->AllowNTLMCredentialsForAllDomains(should_allow);
}
std::string App::GetLocale() {
return l10n_util::GetApplicationLocale("");
}
@ -285,6 +291,8 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder(
.SetMethod("getPath", &App::GetPath)
.SetMethod("setDesktopName", &App::SetDesktopName)
.SetMethod("setAppUserModelId", &App::SetAppUserModelId)
.SetMethod("allowNTLMCredentialsForAllDomains",
&App::AllowNTLMCredentialsForAllDomains)
.SetMethod("getLocale", &App::GetLocale)
.SetProperty("defaultSession", &App::DefaultSession);
}

View file

@ -65,6 +65,8 @@ class App : public mate::EventEmitter,
void SetDesktopName(const std::string& desktop_name);
void SetAppUserModelId(const std::string& app_id);
void AllowNTLMCredentialsForAllDomains(bool should_allow);
std::string GetLocale();
v8::Local<v8::Value> DefaultSession(v8::Isolate* isolate);