Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1296)

Unified Diff: chrome/browser/omaha_query_params/omaha_query_params.cc

Issue 153273002: Include the language (locale) info in the update ping (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments, Unittest Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/omaha_query_params/omaha_query_params.cc
diff --git a/chrome/common/omaha_query_params/omaha_query_params.cc b/chrome/browser/omaha_query_params/omaha_query_params.cc
similarity index 77%
rename from chrome/common/omaha_query_params/omaha_query_params.cc
rename to chrome/browser/omaha_query_params/omaha_query_params.cc
index f68c9be26fce4a9db3288d8451425bca2fdeb62f..14759bb486cc4cb7a7c02c80dd12ef0542df099c 100644
--- a/chrome/common/omaha_query_params/omaha_query_params.cc
+++ b/chrome/browser/omaha_query_params/omaha_query_params.cc
@@ -2,11 +2,12 @@
// 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

Powered by Google App Engine
This is Rietveld 408576698