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

Side by Side Diff: chrome/browser/chromeos/system/input_device_settings.cc

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 "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
(...skipping 12 matching lines...) Expand all
23 namespace chromeos { 23 namespace chromeos {
24 namespace system { 24 namespace system {
25 25
26 namespace { 26 namespace {
27 27
28 const char kTpControl[] = "/opt/google/touchpad/tpcontrol"; 28 const char kTpControl[] = "/opt/google/touchpad/tpcontrol";
29 const char kMouseControl[] = "/opt/google/mouse/mousecontrol"; 29 const char kMouseControl[] = "/opt/google/mouse/mousecontrol";
30 30
31 bool ScriptExists(const std::string& script) { 31 bool ScriptExists(const std::string& script) {
32 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 32 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
33 return file_util::PathExists(base::FilePath(script)); 33 return base::PathExists(base::FilePath(script));
34 } 34 }
35 35
36 // Executes the input control script asynchronously, if it exists. 36 // Executes the input control script asynchronously, if it exists.
37 void ExecuteScriptOnFileThread(const std::vector<std::string>& argv) { 37 void ExecuteScriptOnFileThread(const std::vector<std::string>& argv) {
38 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 38 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
39 DCHECK(!argv.empty()); 39 DCHECK(!argv.empty());
40 const std::string& script(argv[0]); 40 const std::string& script(argv[0]);
41 41
42 // Script must exist on device. 42 // Script must exist on device.
43 DCHECK(!base::chromeos::IsRunningOnChromeOS() || ScriptExists(script)); 43 DCHECK(!base::chromeos::IsRunningOnChromeOS() || ScriptExists(script));
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 void SetPrimaryButtonRight(bool right) { 155 void SetPrimaryButtonRight(bool right) {
156 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 156 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
157 ExecuteScript(3, kMouseControl, "swap_left_right", right ? "1" : "0"); 157 ExecuteScript(3, kMouseControl, "swap_left_right", right ? "1" : "0");
158 } 158 }
159 159
160 } // namespace mouse_settings 160 } // namespace mouse_settings
161 161
162 } // namespace system 162 } // namespace system
163 } // namespace chromeos 163 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/settings/owner_key_util.cc ('k') | chrome/browser/chromeos/system/timezone_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698