Refactor version-getting info into a chrome::VersionInfo object.
I was trying to replace wstring usage in base::FileVersionInfo, but
that class is rather Windows-specific with strange fields like
"private_build()" where the value and encoding aren't clear. 95%
of the users of FileVersionInfo actually just care about the current
Chrome version, so we can provide a much simpler interface for them.
We still use FileVersionInfo for retrieving information from e.g.
plugin DLLs, but in those cases the usage is clearer.
Review URL: http://codereview.chromium.org/3135028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57725 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 611349b..340d0ca 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -8,7 +8,6 @@
#include "base/base64.h"
#endif
#include "base/environment.h"
-#include "base/file_version_info.h"
#include "base/histogram.h"
#include "base/logging.h"
#include "base/rand_util.h"
@@ -76,11 +75,11 @@
// The first update must happen between 1-5 minutes of start up.
next_update_sec_ = base::RandInt(60, kSbTimerStartIntervalSec);
- scoped_ptr<FileVersionInfo> version_info(chrome::GetChromeVersionInfo());
- if (!version_info.get())
+ chrome::VersionInfo version_info;
+ if (!version_info.is_valid())
version_ = "0.1";
else
- version_ = WideToASCII(version_info->product_version());
+ version_ = version_info.Version();
}
SafeBrowsingProtocolManager::~SafeBrowsingProtocolManager() {