roll rlz 94:99
Also fix a few minor issues that the compiler complains about on mac, mostly
wstring/string16 confusion. All these changes are no-ops on windows.
95: Move SupplementaryBranding from win/lib/rlz_lib.h to lib/rlz_lib.h
96: Move ClearAllProductEvents() to use RlzValueStore.
97: Move ClearAllProductEvents() to shared code. Pure code move.
98: Move ClearProductState() to RlzValueStore.
99: Move ClearProductState() to common code.
BUG=46579
TEST=none
TBR=rogerta
Review URL: http://codereview.chromium.org/9717012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127322 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/DEPS b/DEPS
index b70edf7..4d76c5d 100644
--- a/DEPS
+++ b/DEPS
@@ -58,7 +58,7 @@
"webrtc_revision": "1903",
"jsoncpp_revision": "248",
"nss_revision": "126189",
- "rlz_revision": "94",
+ "rlz_revision": "99",
}
deps = {
diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc
index 026d3ca..8024106 100644
--- a/chrome/browser/rlz/rlz.cc
+++ b/chrome/browser/rlz/rlz.cc
@@ -106,8 +106,8 @@
rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX,
rlz_lib::CHROME_HOME_PAGE,
rlz_lib::NO_ACCESS_POINT};
- std::string lang_ascii(WideToASCII(lang));
- std::string referral_ascii(WideToASCII(referral));
+ std::string lang_ascii(UTF16ToASCII(lang));
+ std::string referral_ascii(UTF16ToASCII(referral));
return rlz_lib::SendFinancialPing(rlz_lib::CHROME, points, "chrome",
brand.c_str(), referral_ascii.c_str(),
lang_ascii.c_str(), false, true);
@@ -239,7 +239,7 @@
string16 lang;
GoogleUpdateSettings::GetLanguage(&lang);
if (lang.empty())
- lang = L"en";
+ lang = ASCIIToUTF16("en");
string16 referral;
GoogleUpdateSettings::GetReferral(&referral);
@@ -371,7 +371,7 @@
if (!rlz_lib::GetAccessPointRlz(point, str_rlz, rlz_lib::kMaxRlzLength))
return false;
- string16 rlz_local(ASCIIToWide(std::string(str_rlz)));
+ string16 rlz_local(ASCIIToUTF16(std::string(str_rlz)));
if (rlz)
*rlz = rlz_local;
diff --git a/chrome/browser/rlz/rlz.h b/chrome/browser/rlz/rlz.h
index 153d11bf..c33214f 100644
--- a/chrome/browser/rlz/rlz.h
+++ b/chrome/browser/rlz/rlz.h
@@ -18,7 +18,7 @@
#include "base/string16.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
-#include "rlz/win/lib/rlz_lib.h"
+#include "rlz/lib/rlz_lib.h"
// RLZ is a library which is used to measure distribution scenarios.
// Its job is to record certain lifetime events in the registry and to send
@@ -63,7 +63,7 @@
// testing purposes. Production code should never need to call these.
protected:
RLZTracker();
- ~RLZTracker();
+ virtual ~RLZTracker();
// Performs initialization of RLZ tracker that is purposefully delayed so
// that it does not interfere with chrome startup time.
diff --git a/chrome/browser/rlz/rlz_extension_api.h b/chrome/browser/rlz/rlz_extension_api.h
index 45c892e..d091c85 100644
--- a/chrome/browser/rlz/rlz_extension_api.h
+++ b/chrome/browser/rlz/rlz_extension_api.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -13,12 +13,12 @@
#include "chrome/browser/extensions/extension_function.h"
class RlzRecordProductEventFunction : public SyncExtensionFunction {
- virtual bool RunImpl();
+ virtual bool RunImpl() OVERRIDE;
DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.recordProductEvent")
};
class RlzGetAccessPointRlzFunction : public SyncExtensionFunction {
- virtual bool RunImpl();
+ virtual bool RunImpl() OVERRIDE;
DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.getAccessPointRlz")
};
@@ -26,11 +26,11 @@
DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.sendFinancialPing")
// Making this function protected so that it can be overridden in tests.
protected:
- virtual bool RunImpl();
+ virtual bool RunImpl() OVERRIDE;
};
class RlzClearProductStateFunction : public SyncExtensionFunction {
- virtual bool RunImpl();
+ virtual bool RunImpl() OVERRIDE;
DECLARE_EXTENSION_FUNCTION_NAME("experimental.rlz.clearProductState")
};
diff --git a/chrome/browser/rlz/rlz_unittest.cc b/chrome/browser/rlz/rlz_unittest.cc
index eb2afe3..33f04e3 100644
--- a/chrome/browser/rlz/rlz_unittest.cc
+++ b/chrome/browser/rlz/rlz_unittest.cc
@@ -21,6 +21,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "rlz/win/lib/rlz_lib.h" // InitializeTempHivesForTesting
#include "testing/gtest/include/gtest/gtest.h"
using base::win::RegKey;
diff --git a/chrome/browser/search_engines/template_url_unittest.cc b/chrome/browser/search_engines/template_url_unittest.cc
index a9f1307a..c800433f 100644
--- a/chrome/browser/search_engines/template_url_unittest.cc
+++ b/chrome/browser/search_engines/template_url_unittest.cc
@@ -420,12 +420,12 @@
TemplateURLRef ref("http://bar/?{google:RLZ}{searchTerms}", 1, 2);
ASSERT_TRUE(ref.IsValid());
ASSERT_TRUE(ref.SupportsReplacement());
- GURL result(ref.ReplaceSearchTerms(t_url, L"x",
+ GURL result(ref.ReplaceSearchTerms(t_url, ASCIIToUTF16("x"),
TemplateURLRef::NO_SUGGESTIONS_AVAILABLE, string16()));
ASSERT_TRUE(result.is_valid());
std::string expected_url = "http://bar/?";
if (!rlz_string.empty())
- expected_url += "rlz=" + WideToUTF8(rlz_string) + "&";
+ expected_url += "rlz=" + UTF16ToUTF8(rlz_string) + "&";
expected_url += "x";
EXPECT_EQ(expected_url, result.spec());
}
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 0a09c0c..70284cc 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -38,7 +38,7 @@
#include "chrome/installer/util/self_cleaning_temp_dir.h"
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
-#include "rlz/win/lib/rlz_lib.h"
+#include "rlz/lib/rlz_lib.h"
// Build-time generated include file.
#include "registered_dlls.h" // NOLINT