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

Side by Side Diff: base/base_paths_win.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
« no previous file with comments | « base/base_paths_posix.cc ('k') | base/bind_helpers.h » ('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 <windows.h> 5 #include <windows.h>
6 #include <shlobj.h> 6 #include <shlobj.h>
7 7
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 case base::DIR_PROGRAM_FILES: 63 case base::DIR_PROGRAM_FILES:
64 if (FAILED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL, 64 if (FAILED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL,
65 SHGFP_TYPE_CURRENT, system_buffer))) 65 SHGFP_TYPE_CURRENT, system_buffer)))
66 return false; 66 return false;
67 cur = FilePath(system_buffer); 67 cur = FilePath(system_buffer);
68 break; 68 break;
69 case base::DIR_PROGRAM_FILES6432: 69 case base::DIR_PROGRAM_FILES6432:
70 #if !defined(_WIN64) 70 #if !defined(_WIN64)
71 if (base::win::OSInfo::GetInstance()->wow64_status() == 71 if (base::win::OSInfo::GetInstance()->wow64_status() ==
72 base::win::OSInfo::WOW64_ENABLED) { 72 base::win::OSInfo::WOW64_ENABLED) {
73 scoped_ptr<base::Environment> env(base::Environment::Create()); 73 std::unique_ptr<base::Environment> env(base::Environment::Create());
74 std::string programfiles_w6432; 74 std::string programfiles_w6432;
75 // 32-bit process running in WOW64 sets ProgramW6432 environment 75 // 32-bit process running in WOW64 sets ProgramW6432 environment
76 // variable. See 76 // variable. See
77 // https://msdn.microsoft.com/library/windows/desktop/aa384274.aspx. 77 // https://msdn.microsoft.com/library/windows/desktop/aa384274.aspx.
78 if (!env->GetVar("ProgramW6432", &programfiles_w6432)) 78 if (!env->GetVar("ProgramW6432", &programfiles_w6432))
79 return false; 79 return false;
80 // GetVar returns UTF8 - convert back to Wide. 80 // GetVar returns UTF8 - convert back to Wide.
81 cur = FilePath(UTF8ToWide(programfiles_w6432)); 81 cur = FilePath(UTF8ToWide(programfiles_w6432));
82 break; 82 break;
83 } 83 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 break; 185 break;
186 default: 186 default:
187 return false; 187 return false;
188 } 188 }
189 189
190 *result = cur; 190 *result = cur;
191 return true; 191 return true;
192 } 192 }
193 193
194 } // namespace base 194 } // namespace base
OLDNEW
« no previous file with comments | « base/base_paths_posix.cc ('k') | base/bind_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698