summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabodenha@google.com <abodenha@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-22 20:28:51 +0000
committerabodenha@google.com <abodenha@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-22 20:28:51 +0000
commit5fd6433b7344795fd75e53cd1aa946b3ebcccfc9 (patch)
tree14f58b08cd7f0c2b1ac8f895366299a988f4deb4
parentdc2f9f52ff023f5ef11a1bd1f57403bb96fecd4e (diff)
downloadchromium_src-5fd6433b7344795fd75e53cd1aa946b3ebcccfc9.zip
chromium_src-5fd6433b7344795fd75e53cd1aa946b3ebcccfc9.tar.gz
chromium_src-5fd6433b7344795fd75e53cd1aa946b3ebcccfc9.tar.bz2
Revert 82686 - Extend PathService::Get to be able to return the X86 program files path.Cloud print's virtual driver needs this to be able to find the Chrome install directory. Since the port monitor is a 64 bit DLL on 64 bit Windows it needs to request the X86 folder explicitly.BUG=TEST=Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=82567Review URL: http://codereview.chromium.org/6873159
TBR=abodenha@chromium.org Review URL: http://codereview.chromium.org/6880147 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82699 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/base_paths_win.cc8
-rw-r--r--base/base_paths_win.h5
-rw-r--r--cloud_print/virtual_driver/win/port_monitor/port_monitor.cc11
3 files changed, 13 insertions, 11 deletions
diff --git a/base/base_paths_win.cc b/base/base_paths_win.cc
index 343a101..25271e4 100644
--- a/base/base_paths_win.cc
+++ b/base/base_paths_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -55,12 +55,6 @@ bool PathProviderWin(int key, FilePath* result) {
return false;
cur = FilePath(system_buffer);
break;
- case base::DIR_PROGRAM_FILESX86:
- if (FAILED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILESX86, NULL,
- SHGFP_TYPE_CURRENT, system_buffer)))
- return false;
- cur = FilePath(system_buffer);
- break;
case base::DIR_IE_INTERNET_CACHE:
if (FAILED(SHGetFolderPath(NULL, CSIDL_INTERNET_CACHE, NULL,
SHGFP_TYPE_CURRENT, system_buffer)))
diff --git a/base/base_paths_win.h b/base/base_paths_win.h
index 02b1f49..9e2db36 100644
--- a/base/base_paths_win.h
+++ b/base/base_paths_win.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -17,8 +17,7 @@ enum {
DIR_WINDOWS, // Windows directory, usually "c:\windows"
DIR_SYSTEM, // Usually c:\windows\system32"
- DIR_PROGRAM_FILES, // Usually c:\program files
- DIR_PROGRAM_FILESX86, // Usually c:\program files or c:\program files (x86)
+ DIR_PROGRAM_FILES, // Usually c:\program files
DIR_IE_INTERNET_CACHE, // Temporary Internet Files directory.
DIR_COMMON_START_MENU, // Usually "C:\Documents and Settings\All Users\
diff --git a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
index 05c5272..450ef56 100644
--- a/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
+++ b/cloud_print/virtual_driver/win/port_monitor/port_monitor.cc
@@ -273,7 +273,16 @@ bool GetChromeExePath(FilePath* chrome_path) {
// Chrome doesn't appear to be installed per user.
// Now check %programfiles(x86)%\google\chrome\application
- PathService::Get(base::DIR_PROGRAM_FILESX86, &path);
+ // TODO(abodenha@chromium.org) Extend PathService::Get to be able to
+ // return the X86 program files path. At a minimum, use SHGetKnownFolderPath
+ // instead.
+ wchar_t system_buffer[MAX_PATH] = L"";
+ SHGetFolderPath(NULL,
+ CSIDL_PROGRAM_FILESX86,
+ NULL,
+ SHGFP_TYPE_CURRENT,
+ system_buffer);
+ path = FilePath(system_buffer);
path = path.Append(kChromeExePath);
if (file_util::PathExists(path)) {
*chrome_path = FilePath(path.value());