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

Unified Diff: media/audio/linux/audio_manager_linux.cc

Issue 10735034: Linux: Detect Unity as a desktop environment. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add a comment Created 8 years, 5 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
Index: media/audio/linux/audio_manager_linux.cc
===================================================================
--- media/audio/linux/audio_manager_linux.cc (revision 146030)
+++ media/audio/linux/audio_manager_linux.cc (working copy)
@@ -71,11 +71,20 @@
bool AudioManagerLinux::CanShowAudioInputSettings() {
scoped_ptr<base::Environment> env(base::Environment::Create());
- base::nix::DesktopEnvironment desktop = base::nix::GetDesktopEnvironment(
- env.get());
- return (desktop == base::nix::DESKTOP_ENVIRONMENT_GNOME ||
- desktop == base::nix::DESKTOP_ENVIRONMENT_KDE3 ||
- desktop == base::nix::DESKTOP_ENVIRONMENT_KDE4);
+
+ switch (base::nix::GetDesktopEnvironment(env.get())) {
+ case base::nix::DESKTOP_ENVIRONMENT_GNOME:
+ case base::nix::DESKTOP_ENVIRONMENT_KDE3:
+ case base::nix::DESKTOP_ENVIRONMENT_KDE4:
+ return true;
+ case base::nix::DESKTOP_ENVIRONMENT_OTHER:
+ case base::nix::DESKTOP_ENVIRONMENT_UNITY:
+ case base::nix::DESKTOP_ENVIRONMENT_XFCE:
+ return false;
+ }
+ // g++ can't figure out the switch statement has all cases covered.
+ NOTREACHED();
+ return false;
}
void AudioManagerLinux::ShowAudioInputSettings() {

Powered by Google App Engine
This is Rietveld 408576698