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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/audio/linux/audio_manager_linux.h" 5 #include "media/audio/linux/audio_manager_linux.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/nix/xdg_util.h" 10 #include "base/nix/xdg_util.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 void AudioManagerLinux::MuteAll() { 64 void AudioManagerLinux::MuteAll() {
65 NOTIMPLEMENTED(); 65 NOTIMPLEMENTED();
66 } 66 }
67 67
68 void AudioManagerLinux::UnMuteAll() { 68 void AudioManagerLinux::UnMuteAll() {
69 NOTIMPLEMENTED(); 69 NOTIMPLEMENTED();
70 } 70 }
71 71
72 bool AudioManagerLinux::CanShowAudioInputSettings() { 72 bool AudioManagerLinux::CanShowAudioInputSettings() {
73 scoped_ptr<base::Environment> env(base::Environment::Create()); 73 scoped_ptr<base::Environment> env(base::Environment::Create());
74 base::nix::DesktopEnvironment desktop = base::nix::GetDesktopEnvironment( 74
75 env.get()); 75 switch (base::nix::GetDesktopEnvironment(env.get())) {
76 return (desktop == base::nix::DESKTOP_ENVIRONMENT_GNOME || 76 case base::nix::DESKTOP_ENVIRONMENT_GNOME:
77 desktop == base::nix::DESKTOP_ENVIRONMENT_KDE3 || 77 case base::nix::DESKTOP_ENVIRONMENT_KDE3:
78 desktop == base::nix::DESKTOP_ENVIRONMENT_KDE4); 78 case base::nix::DESKTOP_ENVIRONMENT_KDE4:
79 return true;
80 case base::nix::DESKTOP_ENVIRONMENT_OTHER:
81 case base::nix::DESKTOP_ENVIRONMENT_UNITY:
82 case base::nix::DESKTOP_ENVIRONMENT_XFCE:
83 return false;
84 }
85 // g++ can't figure out the switch statement has all cases covered.
86 NOTREACHED();
87 return false;
79 } 88 }
80 89
81 void AudioManagerLinux::ShowAudioInputSettings() { 90 void AudioManagerLinux::ShowAudioInputSettings() {
82 scoped_ptr<base::Environment> env(base::Environment::Create()); 91 scoped_ptr<base::Environment> env(base::Environment::Create());
83 base::nix::DesktopEnvironment desktop = base::nix::GetDesktopEnvironment( 92 base::nix::DesktopEnvironment desktop = base::nix::GetDesktopEnvironment(
84 env.get()); 93 env.get());
85 std::string command((desktop == base::nix::DESKTOP_ENVIRONMENT_GNOME) ? 94 std::string command((desktop == base::nix::DESKTOP_ENVIRONMENT_GNOME) ?
86 "gnome-volume-control" : "kmix"); 95 "gnome-volume-control" : "kmix");
87 base::LaunchProcess(CommandLine(FilePath(command)), base::LaunchOptions(), 96 base::LaunchProcess(CommandLine(FilePath(command)), base::LaunchOptions(),
88 NULL); 97 NULL);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 315 }
307 316
308 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); 317 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get());
309 } 318 }
310 319
311 AudioManager* CreateAudioManager() { 320 AudioManager* CreateAudioManager() {
312 return new AudioManagerLinux(); 321 return new AudioManagerLinux();
313 } 322 }
314 323
315 } // namespace media 324 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698