refactor: move SpecialStoragePolicy from brightray to atom (#13944)

This commit is contained in:
Milan Burda 2018-08-21 17:51:04 +02:00 committed by Shelley Vohr
parent fc730cc705
commit 7253c7f843
8 changed files with 25 additions and 23 deletions

View file

@ -10,6 +10,7 @@
#include "atom/browser/atom_permission_manager.h"
#include "atom/browser/browser.h"
#include "atom/browser/request_context_delegate.h"
#include "atom/browser/special_storage_policy.h"
#include "atom/browser/web_view_manager.h"
#include "atom/common/atom_version.h"
#include "atom/common/chrome_version.h"
@ -42,7 +43,8 @@ AtomBrowserContext::AtomBrowserContext(const std::string& partition,
bool in_memory,
const base::DictionaryValue& options)
: brightray::BrowserContext(partition, in_memory),
url_request_context_getter_(nullptr) {
url_request_context_getter_(nullptr),
storage_policy_(new SpecialStoragePolicy) {
// Construct user agent string.
Browser* browser = Browser::Get();
std::string name = RemoveWhitespace(browser->GetName());
@ -98,6 +100,10 @@ content::PermissionManager* AtomBrowserContext::GetPermissionManager() {
return permission_manager_.get();
}
storage::SpecialStoragePolicy* AtomBrowserContext::GetSpecialStoragePolicy() {
return storage_policy_.get();
}
void AtomBrowserContext::RegisterPrefs(PrefRegistrySimple* pref_registry) {
pref_registry->RegisterFilePathPref(prefs::kSelectFileLastDirectory,
base::FilePath());