refactor: use auto env = base::Environment::Create(); everywhere (#29502)

This commit is contained in:
Milan Burda 2021-06-04 02:23:06 +02:00 committed by GitHub
parent 5929d6335f
commit 00693bab30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 14 additions and 14 deletions

View file

@ -160,7 +160,7 @@ AppIndicatorIcon::AppIndicatorIcon(std::string id,
const gfx::ImageSkia& image,
const std::u16string& tool_tip)
: id_(id) {
std::unique_ptr<base::Environment> env(base::Environment::Create());
auto env = base::Environment::Create();
desktop_env_ = base::nix::GetDesktopEnvironment(env.get());
EnsureLibAppIndicatorLoaded();

View file

@ -19,7 +19,7 @@ namespace {
#if defined(OS_LINUX)
bool IsDesktopEnvironmentUnity() {
std::unique_ptr<base::Environment> env(base::Environment::Create());
auto env = base::Environment::Create();
base::nix::DesktopEnvironment desktop_env =
base::nix::GetDesktopEnvironment(env.get());
return desktop_env == base::nix::DESKTOP_ENVIRONMENT_UNITY;

View file

@ -35,7 +35,7 @@ void SetWindowType(x11::Window window, const std::string& type) {
bool ShouldUseGlobalMenuBar() {
base::ThreadRestrictions::ScopedAllowIO allow_io;
std::unique_ptr<base::Environment> env(base::Environment::Create());
auto env = base::Environment::Create();
if (env->HasVar("ELECTRON_FORCE_WINDOW_MENU_BAR"))
return false;