summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-03 06:22:12 +0000
committerrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-03 06:22:12 +0000
commit46c373a985279036959156ba08f048d49c8cd90e (patch)
tree379f3975b0c5b1b1268b0e325a40acfb1d8df0ed
parent7b96328ff9e87f31aaf6413088f0290cb5a57ead (diff)
downloadchromium_src-46c373a985279036959156ba08f048d49c8cd90e.zip
chromium_src-46c373a985279036959156ba08f048d49c8cd90e.tar.gz
chromium_src-46c373a985279036959156ba08f048d49c8cd90e.tar.bz2
Remove version hacks for platform version.
ChromeOS is now using platform numbers as intended, hence the hacks put in place to extract the platform numbers from the old ChromeOS version numbers are no longer needed. Removed them. R=davemoore@chromium.org,evan@chromium.org,zelidrag@chromium.org BUG=chromium-os:20934 TEST=Checked all places where the version shows up. On the latest build it was breaking, it shows correctly again after this fix. Review URL: http://codereview.chromium.org/8068028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103687 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/sys_info_chromeos.cc11
-rw-r--r--base/sys_info_unittest.cc12
-rw-r--r--chrome/browser/browser_about_handler.cc1
-rw-r--r--chrome/browser/chromeos/login/version_info_updater.cc2
-rw-r--r--chrome/browser/chromeos/version_loader.cc22
-rw-r--r--chrome/browser/chromeos/version_loader.h6
-rw-r--r--chrome/browser/ui/webui/options/chromeos/about_page_handler.cc1
7 files changed, 11 insertions, 44 deletions
diff --git a/base/sys_info_chromeos.cc b/base/sys_info_chromeos.cc
index f724f99..1ada002 100644
--- a/base/sys_info_chromeos.cc
+++ b/base/sys_info_chromeos.cc
@@ -94,20 +94,17 @@ void SysInfo::ParseLsbRelease(const std::string& lsb_release,
size_t length = lsb_release.find_first_of('\n', start_index) - start_index;
std::string version = lsb_release.substr(start_index, length);
StringTokenizer tokenizer(version, ".");
- // TODO(rkc): Ignore the 0. here; fix this once we move Chrome OS version
- // numbers from the 0.xx.yyy.zz format to the xx.yyy.zz format.
- // Refer to http://code.google.com/p/chromium-os/issues/detail?id=15789
- for (int i = 0; i < 4 && tokenizer.GetNext(); i++) {
- if (1 == i) {
+ for (int i = 0; i < 3 && tokenizer.GetNext(); ++i) {
+ if (0 == i) {
StringToInt(tokenizer.token_begin(),
tokenizer.token_end(),
major_version);
*minor_version = *bugfix_version = 0;
- } else if (2 == i) {
+ } else if (1 == i) {
StringToInt(tokenizer.token_begin(),
tokenizer.token_end(),
minor_version);
- } else { // 3 == i
+ } else { // 2 == i
StringToInt(tokenizer.token_begin(),
tokenizer.token_end(),
bugfix_version);
diff --git a/base/sys_info_unittest.cc b/base/sys_info_unittest.cc
index 57eb905..edabdb5 100644
--- a/base/sys_info_unittest.cc
+++ b/base/sys_info_unittest.cc
@@ -54,9 +54,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbers) {
&os_major_version,
&os_minor_version,
&os_bugfix_version);
- EXPECT_EQ(2, os_major_version);
- EXPECT_EQ(3, os_minor_version);
- EXPECT_EQ(4, os_bugfix_version);
+ EXPECT_EQ(1, os_major_version);
+ EXPECT_EQ(2, os_minor_version);
+ EXPECT_EQ(3, os_bugfix_version);
}
TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
@@ -70,9 +70,9 @@ TEST_F(SysInfoTest, GoogleChromeOSVersionNumbersFirst) {
&os_major_version,
&os_minor_version,
&os_bugfix_version);
- EXPECT_EQ(2, os_major_version);
- EXPECT_EQ(3, os_minor_version);
- EXPECT_EQ(4, os_bugfix_version);
+ EXPECT_EQ(1, os_major_version);
+ EXPECT_EQ(2, os_minor_version);
+ EXPECT_EQ(3, os_bugfix_version);
}
TEST_F(SysInfoTest, GoogleChromeOSNoVersionNumbers) {
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 853dc9d..d4a0763 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -1364,7 +1364,6 @@ ChromeOSAboutVersionHandler::ChromeOSAboutVersionHandler(
int request_id)
: source_(source),
request_id_(request_id) {
- loader_.EnablePlatformVersions(true);
loader_.GetVersion(&consumer_,
NewCallback(this, &ChromeOSAboutVersionHandler::OnVersion),
chromeos::VersionLoader::VERSION_FULL);
diff --git a/chrome/browser/chromeos/login/version_info_updater.cc b/chrome/browser/chromeos/login/version_info_updater.cc
index 23b65bc..a33259e 100644
--- a/chrome/browser/chromeos/login/version_info_updater.cc
+++ b/chrome/browser/chromeos/login/version_info_updater.cc
@@ -39,7 +39,6 @@ VersionInfoUpdater::~VersionInfoUpdater() {
void VersionInfoUpdater::StartUpdate(bool is_official_build) {
if (CrosLibrary::Get()->EnsureLoaded()) {
- version_loader_.EnablePlatformVersions(true);
version_loader_.GetVersion(
&version_consumer_,
NewCallback(this, &VersionInfoUpdater::OnVersion),
@@ -199,4 +198,3 @@ void VersionInfoUpdater::OnPolicyStateChanged(
}
} // namespace chromeos
-
diff --git a/chrome/browser/chromeos/version_loader.cc b/chrome/browser/chromeos/version_loader.cc
index c0028e3..80237397 100644
--- a/chrome/browser/chromeos/version_loader.cc
+++ b/chrome/browser/chromeos/version_loader.cc
@@ -22,10 +22,6 @@ namespace chromeos {
// File to look for version number in.
static const char kPathVersion[] = "/etc/lsb-release";
-// TODO(rkc): Remove once we change over the Chrome OS version format.
-// Done for http://code.google.com/p/chromium-os/issues/detail?id=15789
-static const size_t kTrimVersion = 2;
-
// File to look for firmware number in.
static const char kPathFirmware[] = "/var/log/bios_info.txt";
@@ -83,10 +79,6 @@ VersionLoader::Handle VersionLoader::GetFirmware(
return request->handle();
}
-void VersionLoader::EnablePlatformVersions(bool enable) {
- backend_.get()->set_parse_as_platform(enable);
-}
-
// static
std::string VersionLoader::ParseVersion(const std::string& contents,
const std::string& prefix) {
@@ -148,20 +140,6 @@ void VersionLoader::Backend::GetVersion(
version = ParseVersion(
contents,
(format == VERSION_FULL) ? kFullVersionPrefix : kVersionPrefix);
-
- // TODO(rkc): Fix this once we move to xx.yyy version numbers for Chrome OS
- // instead of 0.xx.yyy
- // Done for http://code.google.com/p/chromium-os/issues/detail?id=15789
- if (parse_as_platform_) {
- if (version.size() > kTrimVersion) {
- version = version.substr(kTrimVersion);
- // Strip the major version.
- size_t first_dot = version.find(".");
- if (first_dot != std::string::npos) {
- version = version.substr(first_dot + 1);
- }
- }
- }
}
if (format == VERSION_SHORT_WITH_DATE) {
diff --git a/chrome/browser/chromeos/version_loader.h b/chrome/browser/chromeos/version_loader.h
index bf90bc8..1560b18 100644
--- a/chrome/browser/chromeos/version_loader.h
+++ b/chrome/browser/chromeos/version_loader.h
@@ -78,7 +78,7 @@ class VersionLoader : public CancelableRequestProvider {
// and extract the version.
class Backend : public base::RefCountedThreadSafe<Backend> {
public:
- Backend() : parse_as_platform_(false) {}
+ Backend() {}
// Calls ParseVersion to get the version # and notifies request.
// This is invoked on the file thread.
@@ -90,13 +90,9 @@ class VersionLoader : public CancelableRequestProvider {
// This is invoked on the file thread.
void GetFirmware(scoped_refptr<GetFirmwareRequest> request);
- void set_parse_as_platform(bool value) { parse_as_platform_ = value; }
-
private:
friend class base::RefCountedThreadSafe<Backend>;
- bool parse_as_platform_;
-
~Backend() {}
DISALLOW_COPY_AND_ASSIGN(Backend);
diff --git a/chrome/browser/ui/webui/options/chromeos/about_page_handler.cc b/chrome/browser/ui/webui/options/chromeos/about_page_handler.cc
index c65f357..f1bba1f 100644
--- a/chrome/browser/ui/webui/options/chromeos/about_page_handler.cc
+++ b/chrome/browser/ui/webui/options/chromeos/about_page_handler.cc
@@ -246,7 +246,6 @@ void AboutPageHandler::RegisterMessages() {
void AboutPageHandler::PageReady(const ListValue* args) {
// Version information is loaded from a callback
- loader_.EnablePlatformVersions(true);
loader_.GetVersion(&consumer_,
NewCallback(this, &AboutPageHandler::OnOSVersion),
VersionLoader::VERSION_FULL);