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

Side by Side 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: Move "lang" param to OmahaQueryParams 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/omaha_query_params/omaha_query_params.h" 5 #include "chrome/browser/omaha_query_params/omaha_query_params.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/win/windows_version.h" 9 #include "base/win/windows_version.h"
10 #include "chrome/browser/browser_process.h"
10 #include "chrome/common/chrome_version_info.h" 11 #include "chrome/common/chrome_version_info.h"
11 12
12 namespace { 13 namespace {
13 14
14 const char kUnknown[] = "unknown"; 15 const char kUnknown[] = "unknown";
15 16
16 // The request extra information is the OS and architecture, this helps 17 // The request extra information is the OS and architecture, this helps
17 // the server select the right package to be delivered. 18 // the server select the right package to be delivered.
18 const char kOs[] = 19 const char kOs[] =
19 #if defined(OS_MACOSX) 20 #if defined(OS_MACOSX)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const char kChromiumCrx[] = "chromiumcrx"; 59 const char kChromiumCrx[] = "chromiumcrx";
59 #endif // defined(GOOGLE_CHROME_BUILD) 60 #endif // defined(GOOGLE_CHROME_BUILD)
60 61
61 } // namespace 62 } // namespace
62 63
63 namespace chrome { 64 namespace chrome {
64 65
65 // static 66 // static
66 std::string OmahaQueryParams::Get(ProdId prod) { 67 std::string OmahaQueryParams::Get(ProdId prod) {
67 return base::StringPrintf( 68 return base::StringPrintf(
68 "os=%s&arch=%s&nacl_arch=%s&prod=%s&prodchannel=%s&prodversion=%s", 69 "os=%s&arch=%s&nacl_arch=%s&prod=%s&prodchannel=%s"
70 "&prodversion=%s&lang=%s",
69 kOs, 71 kOs,
70 kArch, 72 kArch,
71 getNaclArch(), 73 getNaclArch(),
72 GetProdIdString(prod), 74 GetProdIdString(prod),
73 GetChannelString(), 75 GetChannelString(),
74 chrome::VersionInfo().Version().c_str()); 76 chrome::VersionInfo().Version().c_str(),
77 GetLang());
75 } 78 }
76 79
77 // static 80 // static
78 const char* OmahaQueryParams::GetProdIdString( 81 const char* OmahaQueryParams::GetProdIdString(
79 chrome::OmahaQueryParams::ProdId prod) { 82 chrome::OmahaQueryParams::ProdId prod) {
80 switch (prod) { 83 switch (prod) {
81 case chrome::OmahaQueryParams::CHROME: 84 case chrome::OmahaQueryParams::CHROME:
82 return kChrome; 85 return kChrome;
83 break; 86 break;
84 case chrome::OmahaQueryParams::CRX: 87 case chrome::OmahaQueryParams::CRX:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 case chrome::VersionInfo::CHANNEL_CANARY: 142 case chrome::VersionInfo::CHANNEL_CANARY:
140 return kCanary; 143 return kCanary;
141 break; 144 break;
142 case chrome::VersionInfo::CHANNEL_UNKNOWN: 145 case chrome::VersionInfo::CHANNEL_UNKNOWN:
143 return kUnknown; 146 return kUnknown;
144 break; 147 break;
145 } 148 }
146 return kUnknown; 149 return kUnknown;
147 } 150 }
148 151
152 const char* OmahaQueryParams::GetLang() {
153 return g_browser_process->GetApplicationLocale().c_str();
154 }
155
149 } // namespace chrome 156 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698