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

Side by Side Diff: chrome/test/chromedriver/chrome_finder.cc

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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
« no previous file with comments | « chrome/test/automation/tab_proxy.cc ('k') | chrome/test/chromedriver/key_converter_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/test/chromedriver/chrome_finder.h" 5 #include "chrome/test/chromedriver/chrome_finder.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base_paths.h" 10 #include "base/base_paths.h"
(...skipping 11 matching lines...) Expand all
22 #endif 22 #endif
23 23
24 namespace { 24 namespace {
25 25
26 #if defined(OS_WIN) 26 #if defined(OS_WIN)
27 void GetApplicationDirs(std::vector<base::FilePath>* locations) { 27 void GetApplicationDirs(std::vector<base::FilePath>* locations) {
28 // Add user-level location. 28 // Add user-level location.
29 scoped_ptr<base::Environment> env(base::Environment::Create()); 29 scoped_ptr<base::Environment> env(base::Environment::Create());
30 std::string home_dir; 30 std::string home_dir;
31 if (env->GetVar("userprofile", &home_dir)) { 31 if (env->GetVar("userprofile", &home_dir)) {
32 base::FilePath default_location(UTF8ToWide(home_dir)); 32 base::FilePath default_location(base::UTF8ToWide(home_dir));
33 if (base::win::GetVersion() < base::win::VERSION_VISTA) { 33 if (base::win::GetVersion() < base::win::VERSION_VISTA) {
34 default_location = default_location.Append( 34 default_location = default_location.Append(
35 L"Local Settings\\Application Data"); 35 L"Local Settings\\Application Data");
36 } else { 36 } else {
37 default_location = default_location.Append(L"AppData\\Local"); 37 default_location = default_location.Append(L"AppData\\Local");
38 } 38 }
39 locations->push_back(default_location); 39 locations->push_back(default_location);
40 } 40 }
41 41
42 // Add the system-level location. 42 // Add the system-level location.
43 std::string program_dir; 43 std::string program_dir;
44 if (env->GetVar("ProgramFiles", &program_dir)) 44 if (env->GetVar("ProgramFiles", &program_dir))
45 locations->push_back(base::FilePath(UTF8ToWide(program_dir))); 45 locations->push_back(base::FilePath(base::UTF8ToWide(program_dir)));
46 if (env->GetVar("ProgramFiles(x86)", &program_dir)) 46 if (env->GetVar("ProgramFiles(x86)", &program_dir))
47 locations->push_back(base::FilePath(UTF8ToWide(program_dir))); 47 locations->push_back(base::FilePath(base::UTF8ToWide(program_dir)));
48 } 48 }
49 #elif defined(OS_LINUX) 49 #elif defined(OS_LINUX)
50 void GetApplicationDirs(std::vector<base::FilePath>* locations) { 50 void GetApplicationDirs(std::vector<base::FilePath>* locations) {
51 locations->push_back(base::FilePath("/opt/google/chrome")); 51 locations->push_back(base::FilePath("/opt/google/chrome"));
52 locations->push_back(base::FilePath("/usr/local/bin")); 52 locations->push_back(base::FilePath("/usr/local/bin"));
53 locations->push_back(base::FilePath("/usr/local/sbin")); 53 locations->push_back(base::FilePath("/usr/local/sbin"));
54 locations->push_back(base::FilePath("/usr/bin")); 54 locations->push_back(base::FilePath("/usr/bin"));
55 locations->push_back(base::FilePath("/usr/sbin")); 55 locations->push_back(base::FilePath("/usr/sbin"));
56 locations->push_back(base::FilePath("/bin")); 56 locations->push_back(base::FilePath("/bin"));
57 locations->push_back(base::FilePath("/sbin")); 57 locations->push_back(base::FilePath("/sbin"));
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 std::vector<base::FilePath> browser_exes( 107 std::vector<base::FilePath> browser_exes(
108 browser_exes_array, browser_exes_array + arraysize(browser_exes_array)); 108 browser_exes_array, browser_exes_array + arraysize(browser_exes_array));
109 std::vector<base::FilePath> locations; 109 std::vector<base::FilePath> locations;
110 GetApplicationDirs(&locations); 110 GetApplicationDirs(&locations);
111 return internal::FindExe( 111 return internal::FindExe(
112 base::Bind(&file_util::PathExists), 112 base::Bind(&file_util::PathExists),
113 browser_exes, 113 browser_exes,
114 locations, 114 locations,
115 browser_exe); 115 browser_exe);
116 } 116 }
OLDNEW
« no previous file with comments | « chrome/test/automation/tab_proxy.cc ('k') | chrome/test/chromedriver/key_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698