summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 20:00:04 +0000
committerrdevlin.cronin@chromium.org <rdevlin.cronin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-14 20:00:04 +0000
commitec4a678eab334528fcefb28ab3e95da1b27c31ea (patch)
tree44716978ee0277635e83311888d7f5ebeb204ace
parent00173aa83e1e9330aef623c6bfed382814fd091f (diff)
downloadchromium_src-ec4a678eab334528fcefb28ab3e95da1b27c31ea.zip
chromium_src-ec4a678eab334528fcefb28ab3e95da1b27c31ea.tar.gz
chromium_src-ec4a678eab334528fcefb28ab3e95da1b27c31ea.tar.bz2
Include the language (locale) info in the update ping
BUG=336614 TBR=thakis@chromium.org (since I "deleted" [read:moved] c/c/omaha/OWNERS, it needs an owner for those changes. cpu@ reviewed, deferred to sorin, who lg'd. But need an owner for CQ. Sorry for the convolution). Review URL: https://codereview.chromium.org/153273002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251403 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/component_updater/component_updater_utils.cc20
-rw-r--r--chrome/browser/component_updater/pnacl/pnacl_component_installer.cc10
-rw-r--r--chrome/browser/extensions/api/runtime/runtime_api.cc8
-rw-r--r--chrome/browser/extensions/updater/extension_updater_unittest.cc2
-rw-r--r--chrome/browser/extensions/updater/manifest_fetch_data.cc2
-rw-r--r--chrome/browser/extensions/webstore_installer.cc4
-rw-r--r--chrome/browser/extensions/webstore_installer_unittest.cc22
-rw-r--r--chrome/browser/omaha_query_params/OWNERS (renamed from chrome/common/omaha_query_params/OWNERS)0
-rw-r--r--chrome/browser/omaha_query_params/omaha_query_params.cc (renamed from chrome/common/omaha_query_params/omaha_query_params.cc)51
-rw-r--r--chrome/browser/omaha_query_params/omaha_query_params.h (renamed from chrome/common/omaha_query_params/omaha_query_params.h)20
-rw-r--r--chrome/browser/omaha_query_params/omaha_query_params_unittest.cc49
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/chrome_common.gypi2
-rw-r--r--chrome/chrome_tests_unit.gypi1
14 files changed, 129 insertions, 64 deletions
diff --git a/chrome/browser/component_updater/component_updater_utils.cc b/chrome/browser/component_updater/component_updater_utils.cc
index efd6d3c..6bc9d58 100644
--- a/chrome/browser/component_updater/component_updater_utils.cc
+++ b/chrome/browser/component_updater/component_updater_utils.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "chrome/browser/component_updater/component_updater_utils.h"
+
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/guid.h"
@@ -14,8 +15,8 @@
#include "base/win/windows_version.h"
#include "chrome/browser/component_updater/component_updater_service.h"
#include "chrome/browser/component_updater/crx_update_item.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "chrome/common/chrome_version_info.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "extensions/common/extension.h"
#include "net/base/load_flags.h"
#include "net/url_request/url_fetcher.h"
@@ -44,14 +45,15 @@ std::string BuildProtocolRequest(const std::string& request_body,
"version=\"%s-%s\" prodversion=\"%s\" "
"requestid=\"{%s}\" updaterchannel=\"%s\" prodchannel=\"%s\" "
"os=\"%s\" arch=\"%s\" nacl_arch=\"%s\"",
- prod_id.c_str(), chrome_version.c_str(), // "version"
- chrome_version.c_str(), // "prodversion"
- base::GenerateGUID().c_str(), // "requestid"
- chrome::OmahaQueryParams::GetChannelString(), // "updaterchannel"
- chrome::OmahaQueryParams::GetChannelString(), // "prodchannel"
- chrome::OmahaQueryParams::getOS(), // "os"
- chrome::OmahaQueryParams::getArch(), // "arch"
- chrome::OmahaQueryParams::getNaclArch()); // "nacl_arch"
+ prod_id.c_str(),
+ chrome_version.c_str(), // "version"
+ chrome_version.c_str(), // "prodversion"
+ base::GenerateGUID().c_str(), // "requestid"
+ chrome::OmahaQueryParams::GetChannelString(), // "updaterchannel"
+ chrome::OmahaQueryParams::GetChannelString(), // "prodchannel"
+ chrome::OmahaQueryParams::GetOS(), // "os"
+ chrome::OmahaQueryParams::GetArch(), // "arch"
+ chrome::OmahaQueryParams::GetNaclArch()); // "nacl_arch"
#if defined(OS_WIN)
const bool is_wow64(
base::win::OSInfo::GetInstance()->wow64_status() ==
diff --git a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
index aba78b0..7a87949 100644
--- a/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
+++ b/chrome/browser/component_updater/pnacl/pnacl_component_installer.cc
@@ -23,10 +23,10 @@
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/component_updater/component_updater_service.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "components/nacl/common/nacl_switches.h"
#include "content/public/browser/browser_thread.h"
@@ -80,7 +80,7 @@ void CheckVersionCompatiblity(const base::Version& current_version) {
// PNaCl is packaged as a multi-CRX. This returns the platform-specific
// subdirectory that is part of that multi-CRX.
base::FilePath GetPlatformDir(const base::FilePath& base_path) {
- std::string arch = SanitizeForPath(OmahaQueryParams::getNaclArch());
+ std::string arch = SanitizeForPath(OmahaQueryParams::GetNaclArch());
return base_path.AppendASCII("_platform_specific").AppendASCII(arch);
}
@@ -192,9 +192,9 @@ bool CheckPnaclComponentManifest(const base::DictionaryValue& manifest,
LOG(WARNING) << "'pnacl-arch' field is missing from pnacl-manifest!";
return false;
}
- if (arch.compare(OmahaQueryParams::getNaclArch()) != 0) {
- LOG(WARNING) << "'pnacl-arch' field in manifest is invalid ("
- << arch << " vs " << OmahaQueryParams::getNaclArch() << ")";
+ if (arch.compare(OmahaQueryParams::GetNaclArch()) != 0) {
+ LOG(WARNING) << "'pnacl-arch' field in manifest is invalid (" << arch
+ << " vs " << OmahaQueryParams::GetNaclArch() << ")";
return false;
}
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc
index 9953abe..682b62c 100644
--- a/chrome/browser/extensions/api/runtime/runtime_api.cc
+++ b/chrome/browser/extensions/api/runtime/runtime_api.cc
@@ -14,13 +14,13 @@
#include "chrome/browser/extensions/extension_host.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/updater/extension_updater.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/extensions/api/runtime.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/render_process_host.h"
@@ -521,7 +521,7 @@ bool RuntimeRestartFunction::RunImpl() {
bool RuntimeGetPlatformInfoFunction::RunImpl() {
GetPlatformInfo::Results::PlatformInfo info;
- const char* os = chrome::OmahaQueryParams::getOS();
+ const char* os = chrome::OmahaQueryParams::GetOS();
if (strcmp(os, "mac") == 0) {
info.os = GetPlatformInfo::Results::PlatformInfo::OS_MAC_;
} else if (strcmp(os, "win") == 0) {
@@ -539,7 +539,7 @@ bool RuntimeGetPlatformInfoFunction::RunImpl() {
return false;
}
- const char* arch = chrome::OmahaQueryParams::getArch();
+ const char* arch = chrome::OmahaQueryParams::GetArch();
if (strcmp(arch, "arm") == 0) {
info.arch = GetPlatformInfo::Results::PlatformInfo::ARCH_ARM;
} else if (strcmp(arch, "x86") == 0) {
@@ -551,7 +551,7 @@ bool RuntimeGetPlatformInfoFunction::RunImpl() {
return false;
}
- const char* nacl_arch = chrome::OmahaQueryParams::getNaclArch();
+ const char* nacl_arch = chrome::OmahaQueryParams::GetNaclArch();
if (strcmp(nacl_arch, "arm") == 0) {
info.nacl_arch = GetPlatformInfo::Results::PlatformInfo::NACL_ARCH_ARM;
} else if (strcmp(nacl_arch, "x86-32") == 0) {
diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc
index c8a235d..e47ae02 100644
--- a/chrome/browser/extensions/updater/extension_updater_unittest.cc
+++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc
@@ -36,8 +36,8 @@
#include "chrome/browser/extensions/updater/manifest_fetch_data.h"
#include "chrome/browser/extensions/updater/request_queue_impl.h"
#include "chrome/browser/google/google_util.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "chrome/browser/prefs/pref_service_syncable.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/notification_details.h"
diff --git a/chrome/browser/extensions/updater/manifest_fetch_data.cc b/chrome/browser/extensions/updater/manifest_fetch_data.cc
index 1bf4250..f780e189 100644
--- a/chrome/browser/extensions/updater/manifest_fetch_data.cc
+++ b/chrome/browser/extensions/updater/manifest_fetch_data.cc
@@ -12,7 +12,7 @@
#include "base/strings/string_util.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/metrics/metrics_service.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "net/base/escape.h"
namespace {
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index 2b68136..f9cacca 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -19,7 +19,6 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/download/download_prefs.h"
@@ -28,13 +27,13 @@
#include "chrome/browser/extensions/install_tracker.h"
#include "chrome/browser/extensions/install_tracker_factory.h"
#include "chrome/browser/extensions/install_verifier.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension_constants.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_save_info.h"
@@ -168,7 +167,6 @@ GURL WebstoreInstaller::GetWebstoreInstallURL(
params.push_back("id=" + extension_id);
if (!install_source.empty())
params.push_back("installsource=" + install_source);
- params.push_back("lang=" + g_browser_process->GetApplicationLocale());
params.push_back("uc");
std::string url_string = extension_urls::GetWebstoreUpdateUrl().spec();
diff --git a/chrome/browser/extensions/webstore_installer_unittest.cc b/chrome/browser/extensions/webstore_installer_unittest.cc
index 734013a..c117003 100644
--- a/chrome/browser/extensions/webstore_installer_unittest.cc
+++ b/chrome/browser/extensions/webstore_installer_unittest.cc
@@ -6,7 +6,7 @@
#include "base/strings/stringprintf.h"
#include "chrome/browser/extensions/webstore_installer.h"
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "extensions/common/id_util.h"
#include "net/base/escape.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -27,14 +27,18 @@ TEST(WebstoreInstallerTest, PlatformParams) {
GURL url = WebstoreInstaller::GetWebstoreInstallURL(id,
WebstoreInstaller::INSTALL_SOURCE_INLINE);
std::string query = url.query();
- EXPECT_TRUE(Contains(query,StringPrintf("os=%s", OmahaQueryParams::getOS())));
- EXPECT_TRUE(Contains(query,StringPrintf("arch=%s",
- OmahaQueryParams::getArch())));
- EXPECT_TRUE(Contains(query,StringPrintf("nacl_arch=%s",
- OmahaQueryParams::getNaclArch())));
- EXPECT_TRUE(Contains(query,net::EscapeQueryParamValue(
- StringPrintf("installsource=%s", source.c_str()),
- true)));
+ EXPECT_TRUE(
+ Contains(query, StringPrintf("os=%s", OmahaQueryParams::GetOS())));
+ EXPECT_TRUE(
+ Contains(query, StringPrintf("arch=%s", OmahaQueryParams::GetArch())));
+ EXPECT_TRUE(Contains(
+ query, StringPrintf("nacl_arch=%s", OmahaQueryParams::GetNaclArch())));
+ EXPECT_TRUE(
+ Contains(query,
+ net::EscapeQueryParamValue(
+ StringPrintf("installsource=%s", source.c_str()), true)));
+ EXPECT_TRUE(
+ Contains(query, StringPrintf("lang=%s", OmahaQueryParams::GetLang())));
}
} // namespace extensions
diff --git a/chrome/common/omaha_query_params/OWNERS b/chrome/browser/omaha_query_params/OWNERS
index c089b54..c089b54 100644
--- a/chrome/common/omaha_query_params/OWNERS
+++ b/chrome/browser/omaha_query_params/OWNERS
diff --git a/chrome/common/omaha_query_params/omaha_query_params.cc b/chrome/browser/omaha_query_params/omaha_query_params.cc
index f68c9be..3730381 100644
--- a/chrome/common/omaha_query_params/omaha_query_params.cc
+++ b/chrome/browser/omaha_query_params/omaha_query_params.cc
@@ -1,12 +1,13 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 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.
-#include "chrome/common/omaha_query_params/omaha_query_params.h"
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
#include "base/compiler_specific.h"
#include "base/strings/stringprintf.h"
#include "base/win/windows_version.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_version_info.h"
namespace {
@@ -17,32 +18,32 @@ const char kUnknown[] = "unknown";
// the server select the right package to be delivered.
const char kOs[] =
#if defined(OS_MACOSX)
- "mac";
+ "mac";
#elif defined(OS_WIN)
- "win";
+ "win";
#elif defined(OS_ANDROID)
- "android";
+ "android";
#elif defined(OS_CHROMEOS)
- "cros";
+ "cros";
#elif defined(OS_LINUX)
- "linux";
+ "linux";
#elif defined(OS_OPENBSD)
- "openbsd";
+ "openbsd";
#else
- #error "unknown os"
+#error "unknown os"
#endif
const char kArch[] =
#if defined(__amd64__) || defined(_WIN64)
- "x64";
+ "x64";
#elif defined(__i386__) || defined(_WIN32)
- "x86";
+ "x86";
#elif defined(__arm__)
- "arm";
+ "arm";
#elif defined(__mips__)
- "mipsel";
+ "mipsel";
#else
- #error "unknown arch"
+#error "unknown arch"
#endif
const char kChrome[] = "chrome";
@@ -65,13 +66,15 @@ namespace chrome {
// static
std::string OmahaQueryParams::Get(ProdId prod) {
return base::StringPrintf(
- "os=%s&arch=%s&nacl_arch=%s&prod=%s&prodchannel=%s&prodversion=%s",
+ "os=%s&arch=%s&nacl_arch=%s&prod=%s&prodchannel=%s"
+ "&prodversion=%s&lang=%s",
kOs,
kArch,
- getNaclArch(),
+ GetNaclArch(),
GetProdIdString(prod),
GetChannelString(),
- chrome::VersionInfo().Version().c_str());
+ chrome::VersionInfo().Version().c_str(),
+ GetLang());
}
// static
@@ -93,17 +96,17 @@ const char* OmahaQueryParams::GetProdIdString(
}
// static
-const char* OmahaQueryParams::getOS() {
+const char* OmahaQueryParams::GetOS() {
return kOs;
}
// static
-const char* OmahaQueryParams::getArch() {
+const char* OmahaQueryParams::GetArch() {
return kArch;
}
// static
-const char* OmahaQueryParams::getNaclArch() {
+const char* OmahaQueryParams::GetNaclArch() {
#if defined(ARCH_CPU_X86_FAMILY)
#if defined(ARCH_CPU_X86_64)
return "x86-64";
@@ -119,8 +122,8 @@ const char* OmahaQueryParams::getNaclArch() {
#elif defined(ARCH_CPU_MIPSEL)
return "mips32";
#else
- // NOTE: when adding new values here, please remember to update the
- // comment in the .h file about possible return values from this function.
+// NOTE: when adding new values here, please remember to update the
+// comment in the .h file about possible return values from this function.
#error "You need to add support for your architecture here"
#endif
}
@@ -146,4 +149,8 @@ const char* OmahaQueryParams::GetChannelString() {
return kUnknown;
}
+const char* OmahaQueryParams::GetLang() {
+ return g_browser_process->GetApplicationLocale().c_str();
+}
+
} // namespace chrome
diff --git a/chrome/common/omaha_query_params/omaha_query_params.h b/chrome/browser/omaha_query_params/omaha_query_params.h
index 145d9ee..ac37c3a 100644
--- a/chrome/common/omaha_query_params/omaha_query_params.h
+++ b/chrome/browser/omaha_query_params/omaha_query_params.h
@@ -1,9 +1,9 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 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.
-#ifndef CHROME_COMMON_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
-#define CHROME_COMMON_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
+#ifndef CHROME_BROWSER_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
+#define CHROME_BROWSER_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
#include <string>
@@ -20,7 +20,7 @@ class OmahaQueryParams {
// Generates a string of URL query paramaters to be used when getting
// component and extension updates. Includes the following fields: os, arch,
- // prod, prodchannel, prodversion.
+ // prod, prodchannel, prodversion, lang.
static std::string Get(ProdId prod);
// Returns the value we use for the "prod=" parameter. Possible return values
@@ -29,27 +29,31 @@ class OmahaQueryParams {
// Returns the value we use for the "os=" parameter. Possible return values
// include: "mac", "win", "android", "cros", "linux", and "openbsd".
- static const char* getOS();
+ static const char* GetOS();
// Returns the value we use for the "arch=" parameter. Possible return values
// include: "x86", "x64", and "arm".
- static const char* getArch();
+ static const char* GetArch();
// Returns the value we use for the "nacl_arch" parameter. Note that this may
// be different from the "arch" parameter above (e.g. one may be 32-bit and
// the other 64-bit). Possible return values include: "x86-32", "x86-64",
// "arm", and "mips32".
- static const char* getNaclArch();
+ static const char* GetNaclArch();
// Returns the value we use for the "updaterchannel=" and "prodchannel="
// parameters. Possible return values include: "canary", "dev", "beta", and
// "stable".
static const char* GetChannelString();
+ // Returns the language for the present locale. Possible return values are
+ // standard tags for languages, such as "en", "en-US", "de", "fr", "af", etc.
+ static const char* GetLang();
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(OmahaQueryParams);
};
} // namespace chrome
-#endif // CHROME_COMMON_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
+#endif // CHROME_BROWSER_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
diff --git a/chrome/browser/omaha_query_params/omaha_query_params_unittest.cc b/chrome/browser/omaha_query_params/omaha_query_params_unittest.cc
new file mode 100644
index 0000000..e8a736a
--- /dev/null
+++ b/chrome/browser/omaha_query_params/omaha_query_params_unittest.cc
@@ -0,0 +1,49 @@
+// Copyright 2014 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.
+
+#include "chrome/browser/omaha_query_params/omaha_query_params.h"
+
+#include "base/strings/stringprintf.h"
+#include "chrome/common/chrome_version_info.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using base::StringPrintf;
+
+namespace chrome {
+
+bool Contains(const std::string& source, const std::string& target) {
+ return source.find(target) != std::string::npos;
+}
+
+void TestParams(OmahaQueryParams::ProdId prod_id) {
+ std::string params = OmahaQueryParams::Get(prod_id);
+
+ // This doesn't so much test what the values are (since that would be an
+ // almost exact duplication of code with omaha_query_params.cc, and wouldn't
+ // really test anything) as it is a verification that all the params are
+ // present in the generated string.
+ EXPECT_TRUE(
+ Contains(params, StringPrintf("os=%s", OmahaQueryParams::GetOS())));
+ EXPECT_TRUE(
+ Contains(params, StringPrintf("arch=%s", OmahaQueryParams::GetArch())));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("prod=%s", OmahaQueryParams::GetProdIdString(prod_id))));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("prodchannel=%s", OmahaQueryParams::GetChannelString())));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("prodversion=%s", chrome::VersionInfo().Version().c_str())));
+ EXPECT_TRUE(Contains(
+ params,
+ StringPrintf("lang=%s", OmahaQueryParams::GetLang())));
+}
+
+TEST(OmahaQueryParams, GetOmahaQueryParams) {
+ TestParams(OmahaQueryParams::CRX);
+ TestParams(OmahaQueryParams::CHROME);
+}
+
+} // namespace chrome
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 495447b..77f402f 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -1441,6 +1441,8 @@
'browser/notifications/sync_notifier/welcome_delegate.h',
'browser/notifications/extension_welcome_notification.cc',
'browser/notifications/extension_welcome_notification.h',
+ 'browser/omaha_query_params/omaha_query_params.h',
+ 'browser/omaha_query_params/omaha_query_params.cc',
'browser/omnibox/omnibox_field_trial.cc',
'browser/omnibox/omnibox_field_trial.h',
'browser/omnibox/omnibox_log.cc',
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index cc0bde1..369bf8a 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -318,8 +318,6 @@
'common/multi_process_lock_linux.cc',
'common/multi_process_lock_mac.cc',
'common/multi_process_lock_win.cc',
- 'common/omaha_query_params/omaha_query_params.cc',
- 'common/omaha_query_params/omaha_query_params.h',
'common/omnibox_focus_state.h',
'common/partial_circular_buffer.cc',
'common/partial_circular_buffer.h',
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index 4f3ec54..5fde315 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -1107,6 +1107,7 @@
'browser/notifications/sync_notifier/sync_notifier_test_utils.h',
'browser/notifications/sync_notifier/welcome_delegate_unittest.cc',
'browser/omnibox/omnibox_field_trial_unittest.cc',
+ 'browser/omaha_query_params/omaha_query_params_unittest.cc',
'browser/parsers/metadata_parser_filebase_unittest.cc',
'browser/password_manager/native_backend_gnome_x_unittest.cc',
'browser/password_manager/native_backend_kwallet_x_unittest.cc',