OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/system/touchpad_settings.h" | 5 #include "chrome/browser/chromeos/system/touchpad_settings.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 bool TPCtrlExists() { | 25 bool TPCtrlExists() { |
26 return file_util::PathExists(FilePath(kTpControl)); | 26 return file_util::PathExists(FilePath(kTpControl)); |
27 } | 27 } |
28 | 28 |
29 // Launches the tpcontrol command asynchronously, if it exists. | 29 // Launches the tpcontrol command asynchronously, if it exists. |
30 void LaunchTpControl(const std::vector<std::string>& argv) { | 30 void LaunchTpControl(const std::vector<std::string>& argv) { |
31 if (!TPCtrlExists()) | 31 if (!TPCtrlExists()) |
32 return; | 32 return; |
33 | 33 |
34 base::LaunchProcess(CommandLine(argv), base::LaunchOptions(), NULL); | 34 base::LaunchOptions options; |
| 35 options.wait = true; |
| 36 base::LaunchProcess(CommandLine(argv), options, NULL); |
35 } | 37 } |
36 | 38 |
37 } // namespace | 39 } // namespace |
38 | 40 |
39 bool TouchpadExists() { | 41 bool TouchpadExists() { |
40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 42 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
41 static bool init = false; | 43 static bool init = false; |
42 static bool exists = false; | 44 static bool exists = false; |
43 | 45 |
44 if (init) | 46 if (init) |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 argv.push_back(kTpControl); | 89 argv.push_back(kTpControl); |
88 argv.push_back("taptoclick"); | 90 argv.push_back("taptoclick"); |
89 argv.push_back(enabled ? "on" : "off"); | 91 argv.push_back(enabled ? "on" : "off"); |
90 | 92 |
91 LaunchTpControl(argv); | 93 LaunchTpControl(argv); |
92 } | 94 } |
93 | 95 |
94 } // namespace touchpad_settings | 96 } // namespace touchpad_settings |
95 } // namespace system | 97 } // namespace system |
96 } // namespace chromeos | 98 } // namespace chromeos |
OLD | NEW |