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

Side by Side Diff: chrome/common/importer/firefox_importer_utils_win.cc

Issue 1513043002: clang/win: Let remaining chromium_code targets build with -Wextra. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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
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 "chrome/common/importer/firefox_importer_utils.h" 5 #include "chrome/common/importer/firefox_importer_utils.h"
6 6
7 #include <shlobj.h> 7 #include <shlobj.h>
8 8
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 14 matching lines...) Expand all
25 static const wchar_t* kFirefoxPath = L"Software\\Mozilla\\Mozilla Firefox"; 25 static const wchar_t* kFirefoxPath = L"Software\\Mozilla\\Mozilla Firefox";
26 static const wchar_t* kCurrentVersion = L"CurrentVersion"; 26 static const wchar_t* kCurrentVersion = L"CurrentVersion";
27 27
28 int GetCurrentFirefoxMajorVersionFromRegistry() { 28 int GetCurrentFirefoxMajorVersionFromRegistry() {
29 TCHAR ver_buffer[128]; 29 TCHAR ver_buffer[128];
30 DWORD ver_buffer_length = sizeof(ver_buffer); 30 DWORD ver_buffer_length = sizeof(ver_buffer);
31 int highest_version = 0; 31 int highest_version = 0;
32 // When installing Firefox with admin account, the product keys will be 32 // When installing Firefox with admin account, the product keys will be
33 // written under HKLM\Mozilla. Otherwise it the keys will be written under 33 // written under HKLM\Mozilla. Otherwise it the keys will be written under
34 // HKCU\Mozilla. 34 // HKCU\Mozilla.
35 for (int i = 0; i < arraysize(kFireFoxRegistryPaths); ++i) { 35 for (const HKEY kFireFoxRegistryPath : kFireFoxRegistryPaths) {
36 base::win::RegKey reg_key(kFireFoxRegistryPaths[i], kFirefoxPath, 36 base::win::RegKey reg_key(kFireFoxRegistryPath, kFirefoxPath, KEY_READ);
37 KEY_READ);
38 37
39 LONG result = reg_key.ReadValue(kCurrentVersion, ver_buffer, 38 LONG result = reg_key.ReadValue(kCurrentVersion, ver_buffer,
40 &ver_buffer_length, NULL); 39 &ver_buffer_length, NULL);
41 if (result != ERROR_SUCCESS) 40 if (result != ERROR_SUCCESS)
42 continue; 41 continue;
43 highest_version = std::max(highest_version, _wtoi(ver_buffer)); 42 highest_version = std::max(highest_version, _wtoi(ver_buffer));
44 } 43 }
45 return highest_version; 44 return highest_version;
46 } 45 }
47 46
(...skipping 25 matching lines...) Expand all
73 // under the "Application Data" folder in Windows XP, Vista, and 7. 72 // under the "Application Data" folder in Windows XP, Vista, and 7.
74 if (!PathService::Get(base::DIR_APP_DATA, &ini_file)) 73 if (!PathService::Get(base::DIR_APP_DATA, &ini_file))
75 return base::FilePath(); 74 return base::FilePath();
76 75
77 ini_file = ini_file.AppendASCII("Mozilla"); 76 ini_file = ini_file.AppendASCII("Mozilla");
78 ini_file = ini_file.AppendASCII("Firefox"); 77 ini_file = ini_file.AppendASCII("Firefox");
79 ini_file = ini_file.AppendASCII("profiles.ini"); 78 ini_file = ini_file.AppendASCII("profiles.ini");
80 79
81 return base::PathExists(ini_file) ? ini_file : base::FilePath(); 80 return base::PathExists(ini_file) ? ini_file : base::FilePath();
82 } 81 }
OLDNEW
« no previous file with comments | « chrome/child/pdf_child_init.cc ('k') | chrome/common/safe_browsing/binary_feature_extractor_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698