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

Side by Side Diff: chrome/browser/policy/policy_path_parser_win.cc

Issue 1507413003: clang/win: Let some chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: content_browsertests Created 5 years 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 | « build/config/compiler/BUILD.gn ('k') | chrome/installer/util/app_command.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 <shlobj.h> 5 #include <shlobj.h>
6 #include <wtsapi32.h> 6 #include <wtsapi32.h>
7 #pragma comment(lib, "wtsapi32.lib") 7 #pragma comment(lib, "wtsapi32.lib")
8 8
9 #include "chrome/browser/policy/policy_path_parser.h" 9 #include "chrome/browser/policy/policy_path_parser.h"
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 if (result.length() == 0) 70 if (result.length() == 0)
71 return result; 71 return result;
72 // Sanitize quotes in case of any around the whole string. 72 // Sanitize quotes in case of any around the whole string.
73 if (result.length() > 1 && 73 if (result.length() > 1 &&
74 ((result[0] == L'"' && result[result.length() - 1] == L'"') || 74 ((result[0] == L'"' && result[result.length() - 1] == L'"') ||
75 (result[0] == L'\'' && result[result.length() - 1] == L'\''))) { 75 (result[0] == L'\'' && result[result.length() - 1] == L'\''))) {
76 // Strip first and last char which should be matching quotes now. 76 // Strip first and last char which should be matching quotes now.
77 result = result.substr(1, result.length() - 2); 77 result = result.substr(1, result.length() - 2);
78 } 78 }
79 // First translate all path variables we recognize. 79 // First translate all path variables we recognize.
80 for (int i = 0; i < arraysize(win_folder_mapping); ++i) { 80 for (size_t i = 0; i < arraysize(win_folder_mapping); ++i) {
81 size_t position = result.find(win_folder_mapping[i].name); 81 size_t position = result.find(win_folder_mapping[i].name);
82 if (position != std::wstring::npos) { 82 if (position != std::wstring::npos) {
83 WCHAR path[MAX_PATH]; 83 WCHAR path[MAX_PATH];
84 ::SHGetSpecialFolderPath(0, path, win_folder_mapping[i].id, false); 84 ::SHGetSpecialFolderPath(0, path, win_folder_mapping[i].id, false);
85 std::wstring path_string(path); 85 std::wstring path_string(path);
86 result.replace(position, wcslen(win_folder_mapping[i].name), path_string); 86 result.replace(position, wcslen(win_folder_mapping[i].name), path_string);
87 } 87 }
88 } 88 }
89 // Next translate other windows specific variables. 89 // Next translate other windows specific variables.
90 size_t position = result.find(kUserNamePolicyVarName); 90 size_t position = result.find(kUserNamePolicyVarName);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 void CheckUserDataDirPolicy(base::FilePath* user_data_dir) { 145 void CheckUserDataDirPolicy(base::FilePath* user_data_dir) {
146 DCHECK(user_data_dir); 146 DCHECK(user_data_dir);
147 // Policy from the HKLM hive has precedence over HKCU. 147 // Policy from the HKLM hive has precedence over HKCU.
148 if (!LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, user_data_dir)) 148 if (!LoadUserDataDirPolicyFromRegistry(HKEY_LOCAL_MACHINE, user_data_dir))
149 LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, user_data_dir); 149 LoadUserDataDirPolicyFromRegistry(HKEY_CURRENT_USER, user_data_dir);
150 } 150 }
151 151
152 } // namespace path_parser 152 } // namespace path_parser
153 153
154 } // namespace policy 154 } // namespace policy
OLDNEW
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | chrome/installer/util/app_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698