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

Unified Diff: chrome/browser/platform_util_win.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Fix unreachable code Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/platform_util_win.cc
diff --git a/chrome/browser/platform_util_win.cc b/chrome/browser/platform_util_win.cc
index 84282394fc82cbb3adcf2a2fd232c0c8396c43f0..bca98ac4049e42cf1e866731dedd49b650c2d06c 100644
--- a/chrome/browser/platform_util_win.cc
+++ b/chrome/browser/platform_util_win.cc
@@ -21,7 +21,6 @@
#include "base/win/registry.h"
#include "base/win/scoped_co_mem.h"
#include "base/win/scoped_comptr.h"
-#include "base/win/windows_version.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/platform_util_internal.h"
#include "content/public/browser/browser_thread.h"
@@ -110,22 +109,6 @@ void ShowItemInFolderOnFileThread(const base::FilePath& full_path) {
}
}
-// Old ShellExecute crashes the process when the command for a given scheme
-// is empty. This function tells if it is.
-bool ValidateShellCommandForScheme(const std::string& scheme) {
- base::win::RegKey key;
- base::string16 registry_path = base::ASCIIToUTF16(scheme) +
- L"\\shell\\open\\command";
- key.Open(HKEY_CLASSES_ROOT, registry_path.c_str(), KEY_READ);
- if (!key.Valid())
- return false;
- DWORD size = 0;
- key.ReadValue(NULL, NULL, &size, NULL);
- if (size <= 2)
- return false;
- return true;
-}
-
void OpenExternalOnFileThread(const GURL& url) {
// Quote the input scheme to be sure that the command does not have
// parameters unexpected by the external program. This url should already
@@ -144,11 +127,6 @@ void OpenExternalOnFileThread(const GURL& url) {
return;
}
- if (base::win::GetVersion() < base::win::VERSION_WIN7) {
- if (!ValidateShellCommandForScheme(url.scheme()))
- return;
- }
-
if (reinterpret_cast<ULONG_PTR>(ShellExecuteA(NULL, "open",
escaped_url.c_str(), NULL, NULL,
SW_SHOWNORMAL)) <= 32) {

Powered by Google App Engine
This is Rietveld 408576698