summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/bug_report_util.cc37
-rw-r--r--chrome/browser/diagnostics/recon_diagnostics.cc21
-rw-r--r--chrome/browser/importer/importer_unittest.cc2
-rw-r--r--chrome/browser/memory_details_win.cc12
-rw-r--r--chrome/browser/nacl_host/nacl_process_host.cc3
-rw-r--r--chrome/browser/ui/views/about_chrome_view.cc4
6 files changed, 46 insertions, 33 deletions
diff --git a/chrome/browser/bug_report_util.cc b/chrome/browser/bug_report_util.cc
index ebb8e24..8ba0e2c 100644
--- a/chrome/browser/bug_report_util.cc
+++ b/chrome/browser/bug_report_util.cc
@@ -13,7 +13,6 @@
#include "base/memory/singleton.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
-#include "base/win/windows_version.h"
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_util.h"
@@ -136,19 +135,19 @@ void BugReportUtil::PostCleanup::OnURLFetchComplete(
// Process the error for debug output
if (response_code == kHttpPostFailNoConnection) {
- error_stream << "No connection to server.";
+ error_stream << "No connection to server.";
} else if ((response_code > kHttpPostFailClientError) &&
- (response_code < kHttpPostFailServerError)) {
- error_stream << "Client error: HTTP response code " << response_code;
+ (response_code < kHttpPostFailServerError)) {
+ error_stream << "Client error: HTTP response code " << response_code;
} else if (response_code > kHttpPostFailServerError) {
- error_stream << "Server error: HTTP response code " << response_code;
+ error_stream << "Server error: HTTP response code " << response_code;
} else {
- error_stream << "Unknown error: HTTP response code " << response_code;
+ error_stream << "Unknown error: HTTP response code " << response_code;
}
}
- LOG(WARNING) << "FEEDBACK: Submission to feedback server (" << url
- << ") status: " << error_stream.str();
+ LOG(WARNING) << "FEEDBACK: Submission to feedback server (" << url <<
+ ") status: " << error_stream.str() << std::endl;
// Delete the URLFetcher.
delete source;
@@ -157,15 +156,21 @@ void BugReportUtil::PostCleanup::OnURLFetchComplete(
}
// static
-void BugReportUtil::SetOSVersion(std::string* os_version) {
+void BugReportUtil::SetOSVersion(std::string *os_version) {
#if defined(OS_WIN)
- base::win::OSInfo* os_info = base::win::OSInfo::GetInstance();
- base::win::OSInfo::VersionNumber version_number = os_info->version_number();
- *os_version = StringPrintf("%d.%d.%d", version_number.major,
- version_number.minor, version_number.build);
- int service_pack = os_info->service_pack().major;
- if (service_pack > 0)
- os_version->append(StringPrintf("Service Pack %d", service_pack));
+ OSVERSIONINFO osvi;
+ ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
+ osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+
+ if (GetVersionEx(&osvi)) {
+ *os_version = StringPrintf("%d.%d.%d %S",
+ osvi.dwMajorVersion,
+ osvi.dwMinorVersion,
+ osvi.dwBuildNumber,
+ osvi.szCSDVersion);
+ } else {
+ *os_version = "unknown";
+ }
#elif defined(OS_MACOSX)
int32 major;
int32 minor;
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index 4ff348e..86666f6 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -47,20 +47,27 @@ class OperatingSystemTest : public DiagnosticTest {
virtual int GetId() { return 0; }
virtual bool ExecuteImpl(DiagnosticsModel::Observer* observer) {
+ int version = 0;
+ int major = 0;
+ int minor = 0;
#if defined(OS_WIN)
- base::win::Version version = base::win::GetVersion();
- if ((version < base::win::VERSION_XP) ||
- ((version == base::win::VERSION_XP) &&
- (base::win::OSInfo::GetInstance()->service_pack().major < 2))) {
- RecordFailure(ASCIIToUTF16("Must have Windows XP SP2 or later"));
+ version = base::win::GetVersion();
+ if (version < base::win::VERSION_XP) {
+ RecordFailure(ASCIIToUTF16("Windows 2000 or earlier"));
+ return false;
+ }
+ base::win::GetServicePackLevel(&major, &minor);
+ if ((version == base::win::VERSION_XP) && (major < 2)) {
+ RecordFailure(ASCIIToUTF16("XP Service Pack 1 or earlier"));
return false;
}
#else
// TODO(port): define the OS criteria for Linux and Mac.
#endif // defined(OS_WIN)
- RecordSuccess(ASCIIToUTF16(StringPrintf("%s %s",
+ RecordSuccess(ASCIIToUTF16(StringPrintf("%s %s (%d [%d:%d])",
base::SysInfo::OperatingSystemName().c_str(),
- base::SysInfo::OperatingSystemVersion().c_str())));
+ base::SysInfo::OperatingSystemVersion().c_str(),
+ version, major, minor)));
return true;
}
diff --git a/chrome/browser/importer/importer_unittest.cc b/chrome/browser/importer/importer_unittest.cc
index 9fe3e12..b0ac166 100644
--- a/chrome/browser/importer/importer_unittest.cc
+++ b/chrome/browser/importer/importer_unittest.cc
@@ -205,7 +205,7 @@ class TestObserver : public ProfileWriter,
EXPECT_EQ(arraysize(kIEBookmarks), bookmark_count_);
EXPECT_EQ(1, history_count_);
#if 0 // This part of the test is disabled. See bug #2466
- if (base::win::GetVersion() >= base::win::VERSION_VISTA)
+ if (base::win::GetVersion() < base::win::VERSION_VISTA)
EXPECT_EQ(0, password_count_);
else
EXPECT_EQ(1, password_count_);
diff --git a/chrome/browser/memory_details_win.cc b/chrome/browser/memory_details_win.cc
index 576c74c..c954a8e 100644
--- a/chrome/browser/memory_details_win.cc
+++ b/chrome/browser/memory_details_win.cc
@@ -72,8 +72,8 @@ void MemoryDetails::CollectProcessData(
for (unsigned int index = 0; index < process_data_.size(); index++)
process_data_[index].processes.clear();
- base::win::OSInfo::WindowsArchitecture windows_architecture =
- base::win::OSInfo::GetInstance()->architecture();
+ base::win::WindowsArchitecture windows_architecture =
+ base::win::GetWindowsArchitecture();
base::win::ScopedHandle snapshot(
::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0));
@@ -93,10 +93,10 @@ void MemoryDetails::CollectProcessData(
if (!process_handle.Get())
continue;
bool is_64bit_process =
- ((windows_architecture == base::win::OSInfo::X64_ARCHITECTURE) ||
- (windows_architecture == base::win::OSInfo::IA64_ARCHITECTURE)) &&
- (base::win::OSInfo::GetWOW64StatusForProcess(process_handle) ==
- base::win::OSInfo::WOW64_DISABLED);
+ ((windows_architecture == base::win::X64_ARCHITECTURE) ||
+ (windows_architecture == base::win::IA64_ARCHITECTURE)) &&
+ (base::win::GetWOW64StatusForProcess(process_handle) ==
+ base::win::WOW64_DISABLED);
for (unsigned int index2 = 0; index2 < process_data_.size(); index2++) {
if (_wcsicmp(process_data_[index2].process_name.c_str(),
process_entry.szExeFile) != 0)
diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc
index d23b51c..528e380 100644
--- a/chrome/browser/nacl_host/nacl_process_host.cc
+++ b/chrome/browser/nacl_host/nacl_process_host.cc
@@ -56,8 +56,7 @@ NaClProcessHost::NaClProcessHost(const std::wstring& url)
running_on_wow64_(false) {
set_name(url);
#if defined(OS_WIN)
- running_on_wow64_ = (base::win::OSInfo::GetInstance()->wow64_status() ==
- base::win::OSInfo::WOW64_ENABLED);
+ running_on_wow64_ = (base::win::GetWOW64Status() == base::win::WOW64_ENABLED);
#endif
}
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index 93faa2a..70505fb 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -532,8 +532,10 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add,
// on-demand updates. Silent updates (in the background) should still
// work as before - enabling UAC or installing the latest service pack
// for Vista is another option.
+ int service_pack_major = 0, service_pack_minor = 0;
+ base::win::GetServicePackLevel(&service_pack_major, &service_pack_minor);
if (!(base::win::GetVersion() == base::win::VERSION_VISTA &&
- (base::win::OSInfo::GetInstance()->service_pack().major == 0) &&
+ (service_pack_major == 0) &&
!base::win::UserAccountControlIsEnabled())) {
UpdateStatus(UPGRADE_CHECK_STARTED, GOOGLE_UPDATE_NO_ERROR);
// CheckForUpdate(false, ...) means don't upgrade yet.