| OLD | NEW |
| 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 <setupapi.h> // Must be included after windows.h | 6 #include <setupapi.h> // Must be included after windows.h |
| 7 #include <winspool.h> | 7 #include <winspool.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <iomanip> | 10 #include <iomanip> |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 LOG(ERROR) << "Unable to delete printer"; | 250 LOG(ERROR) << "Unable to delete printer"; |
| 251 ClosePrinter(handle); | 251 ClosePrinter(handle); |
| 252 return result; | 252 return result; |
| 253 } | 253 } |
| 254 ClosePrinter(handle); | 254 ClosePrinter(handle); |
| 255 return S_OK; | 255 return S_OK; |
| 256 } | 256 } |
| 257 | 257 |
| 258 bool IsOSSupported() { | 258 bool IsOSSupported() { |
| 259 // We don't support Vista or older. | 259 // We don't support Vista or older. |
| 260 base::win::Version version = base::win::GetVersion(); | 260 return base::win::GetVersion() >= base::win::VERSION_WIN7; |
| 261 return (version >= base::win::VERSION_WIN7); | |
| 262 } | 261 } |
| 263 | 262 |
| 264 HRESULT RegisterVirtualDriver(const base::FilePath& install_path) { | 263 HRESULT RegisterVirtualDriver(const base::FilePath& install_path) { |
| 265 HRESULT result = S_OK; | 264 HRESULT result = S_OK; |
| 266 | 265 |
| 267 DCHECK(base::DirectoryExists(install_path)); | 266 DCHECK(base::DirectoryExists(install_path)); |
| 268 if (!IsOSSupported()) { | 267 if (!IsOSSupported()) { |
| 269 LOG(ERROR) << "Requires Windows 7 or later."; | 268 LOG(ERROR) << "Requires Windows 7 or later."; |
| 270 return HRESULT_FROM_WIN32(ERROR_OLD_WIN_VERSION); | 269 return HRESULT_FROM_WIN32(ERROR_OLD_WIN_VERSION); |
| 271 } | 270 } |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 424 |
| 426 VLOG(0) << GetErrorMessage(retval) << " HRESULT=0x" << std::setbase(16) | 425 VLOG(0) << GetErrorMessage(retval) << " HRESULT=0x" << std::setbase(16) |
| 427 << retval; | 426 << retval; |
| 428 | 427 |
| 429 // Installer is silent by default as required by Google Update. | 428 // Installer is silent by default as required by Google Update. |
| 430 if (base::CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { | 429 if (base::CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { |
| 431 DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); | 430 DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); |
| 432 } | 431 } |
| 433 return retval; | 432 return retval; |
| 434 } | 433 } |
| OLD | NEW |