Don't use base::DIR_APP_DATA on Linux
It doesn't exist. Instead, match content_shell by putting application-specific data in $XDG_CONFIG_HOME or ~/.config.
This commit is contained in:
parent
22ea2073df
commit
9638e3956f
1 changed files with 13 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
|||
#include "browser/network_delegate.h"
|
||||
#include "common/application_info.h"
|
||||
|
||||
#include "base/environment.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/prefs/json_pref_store.h"
|
||||
|
@ -20,6 +21,10 @@
|
|||
#include "content/public/browser/storage_partition.h"
|
||||
#include "url_request_context_getter.h"
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
#include "base/nix/xdg_util.h"
|
||||
#endif
|
||||
|
||||
namespace brightray {
|
||||
|
||||
class BrowserContext::ResourceContext : public content::ResourceContext {
|
||||
|
@ -83,7 +88,15 @@ base::FilePath BrowserContext::GetPath() {
|
|||
return path_;
|
||||
|
||||
base::FilePath path;
|
||||
#if defined(OS_LINUX)
|
||||
scoped_ptr<base::Environment> env(base::Environment::Create());
|
||||
path = base::nix::GetXDGDirectory(env.get(),
|
||||
base::nix::kXdgConfigHomeEnvVar,
|
||||
base::nix::kDotConfigDir);
|
||||
#else
|
||||
CHECK(PathService::Get(base::DIR_APP_DATA, &path));
|
||||
#endif
|
||||
|
||||
path_ = path.Append(base::FilePath::FromUTF8Unsafe(GetApplicationName()));
|
||||
return path_;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue