Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: base/nix/xdg_util.cc

Issue 2780863003: Fix base::nix::GetDesktopEnvironment for newer versions of Unity (Closed)
Patch Set: add new tests Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/nix/xdg_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nix/xdg_util.cc
diff --git a/base/nix/xdg_util.cc b/base/nix/xdg_util.cc
index f76c0cb38b15f1208e591e85c9fd6531961b7901..41a89147b9edac19ebcd4c4a8d21b3d0c2873811 100644
--- a/base/nix/xdg_util.cc
+++ b/base/nix/xdg_util.cc
@@ -11,6 +11,7 @@
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/path_service.h"
+#include "base/strings/string_util.h"
#include "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h"
namespace {
@@ -57,7 +58,8 @@ DesktopEnvironment GetDesktopEnvironment(Environment* env) {
std::string xdg_current_desktop;
if (env->GetVar("XDG_CURRENT_DESKTOP", &xdg_current_desktop)) {
// Not all desktop environments set this env var as of this writing.
- if (xdg_current_desktop == "Unity") {
+ if (base::StartsWith(xdg_current_desktop, "Unity",
+ base::CompareCase::SENSITIVE)) {
// gnome-fallback sessions set XDG_CURRENT_DESKTOP to Unity
// DESKTOP_SESSION can be gnome-fallback or gnome-fallback-compiz
std::string desktop_session;
« no previous file with comments | « no previous file | base/nix/xdg_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698