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

Side by Side Diff: chrome_frame/chrome_launcher_utils.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
« no previous file with comments | « chrome/utility/chrome_content_utility_client.cc ('k') | chrome_frame/chrome_tab.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) 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_frame/chrome_launcher_utils.h" 5 #include "chrome_frame/chrome_launcher_utils.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 16 matching lines...) Expand all
27 bool CreateChromeLauncherCommandLine(scoped_ptr<CommandLine>* command_line) { 27 bool CreateChromeLauncherCommandLine(scoped_ptr<CommandLine>* command_line) {
28 DCHECK(command_line); 28 DCHECK(command_line);
29 bool success = false; 29 bool success = false;
30 // The launcher EXE will be in the same directory as the Chrome Frame DLL, 30 // The launcher EXE will be in the same directory as the Chrome Frame DLL,
31 // so create a full path to it based on this assumption. 31 // so create a full path to it based on this assumption.
32 base::FilePath module_path; 32 base::FilePath module_path;
33 if (PathService::Get(base::FILE_MODULE, &module_path)) { 33 if (PathService::Get(base::FILE_MODULE, &module_path)) {
34 base::FilePath current_dir = module_path.DirName(); 34 base::FilePath current_dir = module_path.DirName();
35 base::FilePath chrome_launcher = current_dir.Append( 35 base::FilePath chrome_launcher = current_dir.Append(
36 chrome_launcher::kLauncherExeBaseName); 36 chrome_launcher::kLauncherExeBaseName);
37 if (file_util::PathExists(chrome_launcher)) { 37 if (base::PathExists(chrome_launcher)) {
38 command_line->reset(new CommandLine(chrome_launcher)); 38 command_line->reset(new CommandLine(chrome_launcher));
39 success = true; 39 success = true;
40 } 40 }
41 } 41 }
42 42
43 if (!success) { 43 if (!success) {
44 NOTREACHED() << "Could not find " << chrome_launcher::kLauncherExeBaseName 44 NOTREACHED() << "Could not find " << chrome_launcher::kLauncherExeBaseName
45 << " in output dir."; 45 << " in output dir.";
46 } 46 }
47 47
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 91
92 base::FilePath GetChromeExecutablePath() { 92 base::FilePath GetChromeExecutablePath() {
93 base::FilePath cur_path; 93 base::FilePath cur_path;
94 PathService::Get(base::DIR_MODULE, &cur_path); 94 PathService::Get(base::DIR_MODULE, &cur_path);
95 cur_path = cur_path.Append(chrome::kBrowserProcessExecutableName); 95 cur_path = cur_path.Append(chrome::kBrowserProcessExecutableName);
96 96
97 // The installation model for Chrome places the DLLs in a versioned 97 // The installation model for Chrome places the DLLs in a versioned
98 // sub-folder one down from the Chrome executable. If we fail to find 98 // sub-folder one down from the Chrome executable. If we fail to find
99 // chrome.exe in the current path, try looking one up and launching that 99 // chrome.exe in the current path, try looking one up and launching that
100 // instead. 100 // instead.
101 if (!file_util::PathExists(cur_path)) { 101 if (!base::PathExists(cur_path)) {
102 PathService::Get(base::DIR_MODULE, &cur_path); 102 PathService::Get(base::DIR_MODULE, &cur_path);
103 cur_path = cur_path.DirName().Append(chrome::kBrowserProcessExecutableName); 103 cur_path = cur_path.DirName().Append(chrome::kBrowserProcessExecutableName);
104 } 104 }
105 105
106 return cur_path; 106 return cur_path;
107 } 107 }
108 108
109 } // namespace chrome_launcher 109 } // namespace chrome_launcher
OLDNEW
« no previous file with comments | « chrome/utility/chrome_content_utility_client.cc ('k') | chrome_frame/chrome_tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698