Chromium Code Reviews| Index: chrome/browser/chromeos/system/touchpad_settings.cc |
| =================================================================== |
| --- chrome/browser/chromeos/system/touchpad_settings.cc (revision 104953) |
| +++ chrome/browser/chromeos/system/touchpad_settings.cc (working copy) |
| @@ -19,26 +19,26 @@ |
| namespace touchpad_settings { |
| namespace { |
| const char* kTpControl = "/opt/google/touchpad/tpcontrol"; |
| -} // namespace |
| // Launches the tpcontrol command asynchronously, if it exists. |
| void LaunchTpControl(const std::vector<std::string>& argv) { |
| - if (!system::runtime_environment::IsRunningOnChromeOS()) { |
| - // Do nothing on Linux desktop, as the command does not exist. |
| + if (!TouchpadExists()) |
| return; |
| - } |
| - if (!file_util::PathExists(FilePath(argv[0]))) { |
| - LOG(ERROR) << argv[0] << " not found"; |
| - return; |
| - } |
| - |
| base::LaunchOptions options; |
| options.wait = false; // Launch asynchronously. |
| base::LaunchProcess(CommandLine(argv), options, NULL); |
| } |
| +} // namespace |
| + |
| +bool TouchpadExists() { |
| + // Do nothing on Linux desktop, as the command does not exist. |
| + return system::runtime_environment::IsRunningOnChromeOS() && |
| + file_util::PathExists(FilePath(kTpControl)); |
|
DaveMoore
2011/10/13 00:04:43
This file exists even on devices with no touchpad.
achuithb
2011/10/13 00:06:44
How do you tell if there's no touchpad then?
|
| +} |
| + |
| void SetSensitivity(int value) { |
| // Run this on the FILE thread. |
| if (!BrowserThread::CurrentlyOn(BrowserThread::FILE)) { |