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

Add user component define for extensions path #1

Merged
merged 1 commit into from
Sep 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions browser/browser_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "content/public/browser/resource_context.h"
#include "content/public/browser/storage_partition.h"
#include "net/base/escape.h"
#include "components/component_updater/component_updater_paths.h"

using content::BrowserThread;

Expand Down Expand Up @@ -83,6 +84,13 @@ BrowserContext::BrowserContext(const std::string& partition, bool in_memory)
PathService::Override(DIR_USER_DATA, path_);
}

if (!PathService::Get(component_updater::DIR_COMPONENT_USER, &path_)) {
base::FilePath component_path =
path_.Append(FILE_PATH_LITERAL("Extensions"));
PathService::Override(component_updater::DIR_COMPONENT_USER, component_path);
}


if (!in_memory_ && !partition.empty())
path_ = path_.Append(FILE_PATH_LITERAL("Partitions"))
.Append(base::FilePath::FromUTF8Unsafe(MakePartitionName(partition)));
Expand Down