1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_QUERY_PARAMS_H_
6 #define COMPONENTS_UPDATE_CLIENT_UPDATE_QUERY_PARAMS_H_
10 #include "base/basictypes.h"
12 namespace update_client
{
14 class UpdateQueryParamsDelegate
;
16 // Generates a string of URL query parameters to be used when getting
17 // component and extension updates. These parameters generally remain
18 // fixed for a particular build. Embedders can use the delegate to
19 // define different implementations. This should be used only in the
21 class UpdateQueryParams
{
28 // Generates a string of URL query parameters for Omaha. Includes the
29 // following fields: "os", "arch", "nacl_arch", "prod", "prodchannel",
30 // "prodversion", and "lang"
31 static std::string
Get(ProdId prod
);
33 // Returns the value we use for the "prod=" parameter. Possible return values
34 // include "chrome", "chromecrx", "chromiumcrx", and "unknown".
35 static const char* GetProdIdString(ProdId prod
);
37 // Returns the value we use for the "os=" parameter. Possible return values
38 // include: "mac", "win", "android", "cros", "linux", and "openbsd".
39 static const char* GetOS();
41 // Returns the value we use for the "arch=" parameter. Possible return values
42 // include: "x86", "x64", and "arm".
43 static const char* GetArch();
45 // Returns the value we use for the "nacl_arch" parameter. Note that this may
46 // be different from the "arch" parameter above (e.g. one may be 32-bit and
47 // the other 64-bit). Possible return values include: "x86-32", "x86-64",
48 // "arm", and "mips32".
49 static const char* GetNaclArch();
52 static void SetDelegate(UpdateQueryParamsDelegate
* delegate
);
55 DISALLOW_IMPLICIT_CONSTRUCTORS(UpdateQueryParams
);
58 } // namespace update_client
60 #endif // COMPONENTS_UPDATE_CLIENT_UPDATE_QUERY_PARAMS_H_