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

Unified Diff: chrome/browser/chromeos/system/touchpad_settings.cc

Issue 8249011: Remove 'Enable tap-to-click' checkbox for non-touchpad devices. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: add missing system_options.html file Created 9 years, 2 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: 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)) {
« no previous file with comments | « chrome/browser/chromeos/system/touchpad_settings.h ('k') | chrome/browser/resources/options/chromeos/system_options.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698