Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Add Session::IsOffTheRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Feb 5, 2018
1 parent 7be7b58 commit edad1b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions atom/browser/api/atom_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,16 @@ bool Session::Equal(Session* session) const {
#endif
}

bool Session::IsOffTheRecord() const {
brave::BraveBrowserContext* brave_browser_context =
brave::BraveBrowserContext::FromBrowserContext(profile_);
if (brave_browser_context->IsOffTheRecord())
return true;
if (brave_browser_context->IsIsolatedStorage())
return true;
return false;
}

// static
mate::Handle<Session> Session::CreateFrom(
v8::Isolate* isolate, content::BrowserContext* browser_context) {
Expand Down Expand Up @@ -649,6 +659,7 @@ void Session::BuildPrototype(v8::Isolate* isolate,
&Session::AllowNTLMCredentialsForDomains)
.SetMethod("setEnableBrotli", &Session::SetEnableBrotli)
.SetMethod("equal", &Session::Equal)
.SetMethod("isOffTheRecord", &Session::IsOffTheRecord)
.SetProperty("partition", &Session::Partition)
.SetProperty("contentSettings", &Session::ContentSettings)
.SetProperty("userPrefs", &Session::UserPrefs)
Expand Down
1 change: 1 addition & 0 deletions atom/browser/api/atom_api_session.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Session: public mate::TrackableObject<Session>,
v8::Local<v8::Value> SpellChecker(v8::Isolate* isolate);
v8::Local<v8::Value> Extensions(v8::Isolate* isolate);
bool Equal(Session* session) const;
bool IsOffTheRecord() const;

protected:
Session(v8::Isolate* isolate, Profile* browser_context);
Expand Down

0 comments on commit edad1b2

Please sign in to comment.