summaryrefslogtreecommitdiffstats
path: root/ceee
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-18 02:15:12 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-18 02:15:12 +0000
commit176ab8038d7c1b291dcec51f29ed81f9fba52b8e (patch)
treecf837db3622bc957a21309e96005e16a94cf594d /ceee
parentab9cb282693fb8e36b2d035fccd07d4b93acf65f (diff)
downloadchromium_src-176ab8038d7c1b291dcec51f29ed81f9fba52b8e.zip
chromium_src-176ab8038d7c1b291dcec51f29ed81f9fba52b8e.tar.gz
chromium_src-176ab8038d7c1b291dcec51f29ed81f9fba52b8e.tar.bz2
Add shared macros for stringizing and converting ANSI string constants
(in particular defined by macros) to wide string constants. Convert existing locally-defined stringizing to use the shared macros. Unit tests for the shared macros. This also fixes a minor bug in ceee_module_util.cc where I accidentally quoted a string constant I only meant to convert to wide (this caused no bug, but was unintended, so the change in semantics in that file in the current change is intentional). BUG=none TEST=automated tests Review URL: http://codereview.chromium.org/5103001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66579 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ceee')
-rw-r--r--ceee/ie/common/ceee_module_util.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/ceee/ie/common/ceee_module_util.cc b/ceee/ie/common/ceee_module_util.cc
index 6197d30..930520f 100644
--- a/ceee/ie/common/ceee_module_util.cc
+++ b/ceee/ie/common/ceee_module_util.cc
@@ -10,17 +10,13 @@
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
+#include "base/stringize_macros.h"
#include "base/win/registry.h"
#include "ceee/common/process_utils_win.h"
#include "chrome/installer/util/google_update_constants.h"
#include "version.h" // NOLINT
-// TODO(joi@chromium.org): would be nice to move these (and non-L counterparts)
-// to e.g. base/string_util.h
-#define LSTRINGIZE2(x) L ## #x
-#define LSTRINGIZE(x) LSTRINGIZE2(x)
-
namespace {
const wchar_t* kRegistryPath = L"SOFTWARE\\Google\\CEEE";
@@ -196,7 +192,7 @@ bool NeedToInstallExtension() {
base::win::RegKey hkcu(HKEY_CURRENT_USER, kRegistryPath, KEY_READ);
success = hkcu.ReadValue(
kRegistryValueCrxInstalledByVersion, &version_string);
- return !success || version_string != LSTRINGIZE(CHROME_VERSION_STRING);
+ return !success || version_string != TO_L_STRING(CHROME_VERSION_STRING);
}
}
@@ -224,7 +220,7 @@ void SetInstalledExtensionPath(const FilePath& path) {
DCHECK(write_result);
write_result = key.WriteValue(kRegistryValueCrxInstalledByVersion,
- LSTRINGIZE(CHROME_VERSION_STRING));
+ TO_L_STRING(CHROME_VERSION_STRING));
}
bool IsCrxOrEmpty(const std::wstring& path) {