fix: use correct userData path when unbundled (#30113)
This commit is contained in:
parent
4db7221c7d
commit
bec47f54f4
7 changed files with 32 additions and 36 deletions
|
@ -136,25 +136,25 @@ void Browser::Shutdown() {
|
|||
}
|
||||
|
||||
std::string Browser::GetVersion() const {
|
||||
std::string ret = GetOverriddenApplicationVersion();
|
||||
std::string ret = OverriddenApplicationVersion();
|
||||
if (ret.empty())
|
||||
ret = GetExecutableFileVersion();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Browser::SetVersion(const std::string& version) {
|
||||
OverrideApplicationVersion(version);
|
||||
OverriddenApplicationVersion() = version;
|
||||
}
|
||||
|
||||
std::string Browser::GetName() const {
|
||||
std::string ret = GetOverriddenApplicationName();
|
||||
std::string ret = OverriddenApplicationName();
|
||||
if (ret.empty())
|
||||
ret = GetExecutableFileProductName();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Browser::SetName(const std::string& name) {
|
||||
OverrideApplicationName(name);
|
||||
OverriddenApplicationName() = name;
|
||||
}
|
||||
|
||||
int Browser::GetBadgeCount() {
|
||||
|
|
|
@ -118,11 +118,7 @@ ElectronBrowserContext::ElectronBrowserContext(const std::string& partition,
|
|||
base::StringToInt(command_line->GetSwitchValueASCII(switches::kDiskCacheSize),
|
||||
&max_cache_size_);
|
||||
|
||||
if (!base::PathService::Get(chrome::DIR_USER_DATA, &path_)) {
|
||||
base::PathService::Get(DIR_APP_DATA, &path_);
|
||||
path_ = path_.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
|
||||
base::PathService::Override(chrome::DIR_USER_DATA, path_);
|
||||
}
|
||||
CHECK(base::PathService::Get(chrome::DIR_USER_DATA, &path_));
|
||||
|
||||
if (!in_memory && !partition.empty())
|
||||
path_ = path_.Append(FILE_PATH_LITERAL("Partitions"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue