summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 00:17:22 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 00:17:22 +0000
commit8fcec3c79f1c8f2edae6a1b064cf60c39720ba54 (patch)
treed2949c5b8fc3a926940366ca3a7fe4eaacdc36e7 /chrome/installer/util
parent8622c0c034073504735808dc83dd509ce444b4ae (diff)
downloadchromium_src-8fcec3c79f1c8f2edae6a1b064cf60c39720ba54.zip
chromium_src-8fcec3c79f1c8f2edae6a1b064cf60c39720ba54.tar.gz
chromium_src-8fcec3c79f1c8f2edae6a1b064cf60c39720ba54.tar.bz2
Linux/GTK: implement update notification.
BUG=45148 TEST=compile chrome with PRODUCT_VERSION manually set to something higher than the current version (e.g. 7.0.0.0), and manually set the upgrade detector time to something short (like 10 seconds). Launch chrome and wait a short time for the update notification to appear. The update notification should pulse every few seconds, and should stop pulsing when the user opens the wrench menu. The about menu item should launch a dialog that allows the user to restart chrome, restoring the current session. Review URL: http://codereview.chromium.org/2365003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48795 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r--chrome/installer/util/version.cc22
-rw-r--r--chrome/installer/util/version.h9
2 files changed, 15 insertions, 16 deletions
diff --git a/chrome/installer/util/version.cc b/chrome/installer/util/version.cc
index 0bd9409..2e58076 100644
--- a/chrome/installer/util/version.cc
+++ b/chrome/installer/util/version.cc
@@ -4,19 +4,19 @@
#include <vector>
+#include "base/format_macros.h"
#include "base/string_util.h"
#include "chrome/installer/util/version.h"
installer::Version::Version(int64 major, int64 minor, int64 build,
- int64 patch) :
- major_(major), minor_(minor), build_(build), patch_(patch) {
- version_str_.append(Int64ToWString(major_));
- version_str_.append(L".");
- version_str_.append(Int64ToWString(minor_));
- version_str_.append(L".");
- version_str_.append(Int64ToWString(build_));
- version_str_.append(L".");
- version_str_.append(Int64ToWString(patch_));
+ int64 patch)
+ : major_(major),
+ minor_(minor),
+ build_(build),
+ patch_(patch) {
+ version_str_ = ASCIIToUTF16(
+ StringPrintf("%" PRId64 ".%" PRId64 ".%" PRId64 ".%" PRId64,
+ major_, minor_, build_, patch_));
}
installer::Version::~Version() {
@@ -33,8 +33,8 @@ bool installer::Version::IsHigherThan(const installer::Version* other) const {
}
installer::Version* installer::Version::GetVersionFromString(
- const std::wstring& version_str) {
- std::vector<std::wstring> numbers;
+ const string16& version_str) {
+ std::vector<string16> numbers;
SplitString(version_str, '.', &numbers);
if (numbers.size() != 4) {
diff --git a/chrome/installer/util/version.h b/chrome/installer/util/version.h
index 1f02e00..980fe05 100644
--- a/chrome/installer/util/version.h
+++ b/chrome/installer/util/version.h
@@ -5,9 +5,8 @@
#ifndef CHROME_INSTALLER_UTIL_VERSION_H_
#define CHROME_INSTALLER_UTIL_VERSION_H_
-#include <string>
-
#include "base/basictypes.h"
+#include "base/string16.h"
namespace installer {
@@ -20,21 +19,21 @@ class Version {
bool IsHigherThan(const Version* other) const;
// Return the string representation of this version
- const std::wstring& GetString() const {
+ const string16& GetString() const {
return version_str_;
}
// Assume that the version string is specified by four integers separated
// by character '.'. Return NULL if string is not of this format.
// Caller is responsible for freeing the Version object once done.
- static Version* GetVersionFromString(const std::wstring& version_str);
+ static Version* GetVersionFromString(const string16& version_str);
private:
int64 major_;
int64 minor_;
int64 build_;
int64 patch_;
- std::wstring version_str_;
+ string16 version_str_;
// Classes outside this file do not have any need to create objects of
// this type so declare constructor as private.