OLD | NEW |
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 "chrome/browser/chromeos/system/input_device_settings.h" | 5 #include "chrome/browser/chromeos/system/input_device_settings.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/chromeos/chromeos_version.h" | |
13 #include "base/command_line.h" | 12 #include "base/command_line.h" |
14 #include "base/file_util.h" | 13 #include "base/file_util.h" |
15 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
16 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
17 #include "base/message_loop/message_loop.h" | 16 #include "base/message_loop/message_loop.h" |
18 #include "base/process/kill.h" | 17 #include "base/process/kill.h" |
19 #include "base/process/launch.h" | 18 #include "base/process/launch.h" |
20 #include "base/process/process_handle.h" | 19 #include "base/process/process_handle.h" |
21 #include "base/strings/stringprintf.h" | 20 #include "base/strings/stringprintf.h" |
| 21 #include "base/sys_info.h" |
22 #include "base/task_runner.h" | 22 #include "base/task_runner.h" |
23 #include "base/threading/sequenced_worker_pool.h" | 23 #include "base/threading/sequenced_worker_pool.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" | 25 #include "chrome/browser/chromeos/policy/device_cloud_policy_manager_chromeos.h" |
26 #include "chrome/browser/chromeos/system/statistics_provider.h" | 26 #include "chrome/browser/chromeos/system/statistics_provider.h" |
27 #include "chrome/browser/policy/browser_policy_connector.h" | 27 #include "chrome/browser/policy/browser_policy_connector.h" |
28 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
29 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
30 | 30 |
31 namespace chromeos { | 31 namespace chromeos { |
(...skipping 13 matching lines...) Expand all Loading... |
45 return base::PathExists(base::FilePath(script)); | 45 return base::PathExists(base::FilePath(script)); |
46 } | 46 } |
47 | 47 |
48 // Executes the input control script asynchronously, if it exists. | 48 // Executes the input control script asynchronously, if it exists. |
49 void ExecuteScriptOnFileThread(const std::vector<std::string>& argv) { | 49 void ExecuteScriptOnFileThread(const std::vector<std::string>& argv) { |
50 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); | 50 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
51 DCHECK(!argv.empty()); | 51 DCHECK(!argv.empty()); |
52 const std::string& script(argv[0]); | 52 const std::string& script(argv[0]); |
53 | 53 |
54 // Script must exist on device. | 54 // Script must exist on device. |
55 DCHECK(!base::chromeos::IsRunningOnChromeOS() || ScriptExists(script)); | 55 DCHECK(!base::SysInfo::IsRunningOnChromeOS() || ScriptExists(script)); |
56 | 56 |
57 if (!ScriptExists(script)) | 57 if (!ScriptExists(script)) |
58 return; | 58 return; |
59 | 59 |
60 base::ProcessHandle handle; | 60 base::ProcessHandle handle; |
61 base::LaunchProcess(CommandLine(argv), base::LaunchOptions(), &handle); | 61 base::LaunchProcess(CommandLine(argv), base::LaunchOptions(), &handle); |
62 base::EnsureProcessGetsReaped(handle); | 62 base::EnsureProcessGetsReaped(handle); |
63 } | 63 } |
64 | 64 |
65 void ExecuteScript(int argc, ...) { | 65 void ExecuteScript(int argc, ...) { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 return keyboard_driven; | 208 return keyboard_driven; |
209 } | 209 } |
210 | 210 |
211 return false; | 211 return false; |
212 } | 212 } |
213 | 213 |
214 } // namespace keyboard_settings | 214 } // namespace keyboard_settings |
215 | 215 |
216 } // namespace system | 216 } // namespace system |
217 } // namespace chromeos | 217 } // namespace chromeos |
OLD | NEW |