summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 19:03:37 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-16 19:03:37 +0000
commit1db1b4967ac8f1ecccc9058fa14984982d0779e3 (patch)
tree4f04151ceb6815e83e941f3ba9bc702fd9512977 /chrome/browser
parentf308683a147c096c4d4536e995ea906169af2040 (diff)
downloadchromium_src-1db1b4967ac8f1ecccc9058fa14984982d0779e3.zip
chromium_src-1db1b4967ac8f1ecccc9058fa14984982d0779e3.tar.gz
chromium_src-1db1b4967ac8f1ecccc9058fa14984982d0779e3.tar.bz2
Installer cleanup
1] Remove installer::version and use base::version in installer 2] Use file_util::FileEnumerator instead of calling FindFirstFile directly BUG=none TEST=covered by existing tests Review URL: http://codereview.chromium.org/5687004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_main.cc1
-rw-r--r--chrome/browser/browser_main_win.cc3
-rw-r--r--chrome/browser/ui/views/about_chrome_view.cc10
-rw-r--r--chrome/browser/upgrade_detector.cc13
4 files changed, 11 insertions, 16 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index cab71e2..cf4ee07 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -139,7 +139,6 @@
#include "chrome/installer/util/helper.h"
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/shell_util.h"
-#include "chrome/installer/util/version.h"
#include "gfx/platform_font_win.h"
#include "net/base/net_util.h"
#include "net/base/sdch_manager.h"
diff --git a/chrome/browser/browser_main_win.cc b/chrome/browser/browser_main_win.cc
index 3887968..bd5573a 100644
--- a/chrome/browser/browser_main_win.cc
+++ b/chrome/browser/browser_main_win.cc
@@ -183,8 +183,7 @@ bool CheckMachineLevelInstall() {
// TODO(tommi): Check if using the default distribution is always the right
// thing to do.
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- scoped_ptr<installer::Version> version(InstallUtil::GetChromeVersion(dist,
- true));
+ scoped_ptr<Version> version(InstallUtil::GetChromeVersion(dist, true));
if (version.get()) {
FilePath exe_path;
PathService::Get(base::DIR_EXE, &exe_path);
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index 8e8723f..9e58f04 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -745,15 +745,13 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result,
// Google Update reported that Chrome is up-to-date. Now make sure that we
// are running the latest version and if not, notify the user by falling
// into the next case of UPGRADE_SUCCESSFUL.
- // TODO(tommi): Check if using the default distribution is always the
- // right thing to do.
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- scoped_ptr<installer::Version> installed_version(
+ scoped_ptr<Version> installed_version(
InstallUtil::GetChromeVersion(dist, false));
- scoped_ptr<installer::Version> running_version(
- installer::Version::GetVersionFromString(current_version_));
+ scoped_ptr<Version> running_version(
+ Version::GetVersionFromString(current_version_));
if (!installed_version.get() ||
- !installed_version->IsHigherThan(running_version.get())) {
+ (installed_version->CompareTo(*running_version) < 0)) {
#endif
UserMetrics::RecordAction(
UserMetricsAction("UpgradeCheck_AlreadyUpToDate"), profile_);
diff --git a/chrome/browser/upgrade_detector.cc b/chrome/browser/upgrade_detector.cc
index a8928f1..7f3161d 100644
--- a/chrome/browser/upgrade_detector.cc
+++ b/chrome/browser/upgrade_detector.cc
@@ -30,7 +30,7 @@
#include "chrome/browser/ui/cocoa/keystone_glue.h"
#elif defined(OS_POSIX)
#include "base/process_util.h"
-#include "chrome/installer/util/version.h"
+#include "base/version.h"
#endif
namespace {
@@ -80,7 +80,6 @@ class DetectUpgradeTask : public Task {
virtual void Run() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- using installer::Version;
scoped_ptr<Version> installed_version;
#if defined(OS_WIN)
@@ -97,8 +96,8 @@ class DetectUpgradeTask : public Task {
}
#elif defined(OS_MACOSX)
installed_version.reset(
- Version::GetVersionFromString(
- keystone_glue::CurrentlyInstalledVersion()));
+ Version::GetVersionFromString(UTF16ToWideHack(
+ keystone_glue::CurrentlyInstalledVersion())));
#elif defined(OS_POSIX)
// POSIX but not Mac OS X: Linux, etc.
CommandLine command_line(*CommandLine::ForCurrentProcess());
@@ -109,7 +108,7 @@ class DetectUpgradeTask : public Task {
return;
}
- installed_version.reset(Version::GetVersionFromString(ASCIIToUTF16(reply)));
+ installed_version.reset(Version::GetVersionFromString(reply));
#endif
// Get the version of the currently *running* instance of Chrome.
@@ -119,7 +118,7 @@ class DetectUpgradeTask : public Task {
return;
}
scoped_ptr<Version> running_version(
- Version::GetVersionFromString(ASCIIToUTF16(version_info.Version())));
+ Version::GetVersionFromString(version_info.Version()));
if (running_version.get() == NULL) {
NOTREACHED() << "Failed to parse version info";
return;
@@ -129,7 +128,7 @@ class DetectUpgradeTask : public Task {
// switching from dev to beta channel, for example). The user needs a
// restart in this case as well. See http://crbug.com/46547
if (!installed_version.get() ||
- installed_version->IsHigherThan(running_version.get())) {
+ (installed_version->CompareTo(*running_version) > 0)) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
upgrade_detected_task_);
upgrade_detected_task_ = NULL;