#include "base/nix/xdg_util.h"
#include <optional>
#include <string>
#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/process/launch.h"
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
#include "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h"
#include "base/threading/scoped_blocking_call.h"
namespace {
const char kKDESessionEnvVar[] = …;
base::nix::XdgActivationTokenCreator& GetXdgActivationTokenCreator() { … }
std::optional<std::string>& GetXdgActivationToken() { … }
}
namespace base::nix {
const char kDotConfigDir[] = …;
const char kXdgConfigHomeEnvVar[] = …;
const char kXdgCurrentDesktopEnvVar[] = …;
const char kXdgSessionTypeEnvVar[] = …;
const char kXdgActivationTokenEnvVar[] = …;
const char kXdgActivationTokenSwitch[] = …;
FilePath GetXDGDirectory(Environment* env,
const char* env_name,
const char* fallback_dir) { … }
FilePath GetXDGUserDirectory(const char* dir_name, const char* fallback_dir) { … }
FilePath GetXDGDataWriteLocation(Environment* env) { … }
std::vector<FilePath> GetXDGDataSearchLocations(Environment* env) { … }
DesktopEnvironment GetDesktopEnvironment(Environment* env) { … }
const char* GetDesktopEnvironmentName(DesktopEnvironment env) { … }
const char* GetDesktopEnvironmentName(Environment* env) { … }
SessionType GetSessionType(Environment& env) { … }
std::optional<std::string> ExtractXdgActivationTokenFromEnv(Environment& env) { … }
void ExtractXdgActivationTokenFromCmdLine(base::CommandLine& cmd_line) { … }
std::optional<std::string> TakeXdgActivationToken() { … }
void SetXdgActivationTokenCreator(XdgActivationTokenCreator token_creator) { … }
void CreateLaunchOptionsWithXdgActivation(
XdgActivationLaunchOptionsCallback callback) { … }
}