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

Side by Side Diff: chrome/common/chrome_paths.cc

Issue 296004: Use GetSwitchValueASCII. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/common/child_thread.cc ('k') | chrome/common/logging_chrome.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/common/chrome_paths.h" 5 #include "chrome/common/chrome_paths.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/string_util.h" 11 #include "base/string_util.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "chrome/common/chrome_constants.h" 13 #include "chrome/common/chrome_constants.h"
14 #include "chrome/common/chrome_paths_internal.h" 14 #include "chrome/common/chrome_paths_internal.h"
15 #include "chrome/common/chrome_switches.h" 15 #include "chrome/common/chrome_switches.h"
16 16
17 #if defined(OS_MACOSX) 17 #if defined(OS_MACOSX)
18 #include "base/mac_util.h" 18 #include "base/mac_util.h"
19 #endif 19 #endif
20 20
21 namespace chrome { 21 namespace chrome {
22 22
23 bool GetGearsPluginPathFromCommandLine(FilePath* path) { 23 bool GetGearsPluginPathFromCommandLine(FilePath* path) {
24 #ifndef NDEBUG 24 #ifndef NDEBUG
25 // for debugging, support a cmd line based override 25 // for debugging, support a cmd line based override
26 std::wstring plugin_path = CommandLine::ForCurrentProcess()->GetSwitchValue( 26 FilePath plugin_path =
27 switches::kGearsPluginPathOverride); 27 CommandLine::ForCurrentProcess()->GetSwitchValuePath(
28 // TODO(tc): After GetSwitchNativeValue lands, we don't need to use 28 switches::kGearsPluginPathOverride);
29 // FromWStringHack. 29 *path = plugin_path;
30 *path = FilePath::FromWStringHack(plugin_path);
31 return !plugin_path.empty(); 30 return !plugin_path.empty();
32 #else 31 #else
33 return false; 32 return false;
34 #endif 33 #endif
35 } 34 }
36 35
37 bool PathProvider(int key, FilePath* result) { 36 bool PathProvider(int key, FilePath* result) {
38 // Some keys are just aliases... 37 // Some keys are just aliases...
39 switch (key) { 38 switch (key) {
40 case chrome::DIR_APP: 39 case chrome::DIR_APP:
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return true; 213 return true;
215 } 214 }
216 215
217 // This cannot be done as a static initializer sadly since Visual Studio will 216 // This cannot be done as a static initializer sadly since Visual Studio will
218 // eliminate this object file if there is no direct entry point into it. 217 // eliminate this object file if there is no direct entry point into it.
219 void RegisterPathProvider() { 218 void RegisterPathProvider() {
220 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); 219 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END);
221 } 220 }
222 221
223 } // namespace chrome 222 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/child_thread.cc ('k') | chrome/common/logging_chrome.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698