Roll ANGLE bc75f36:ef9d63e
[chromium-blink-merge.git] / components / omaha_query_params / omaha_query_params.h
blob85ddeac7f654ac49c316b9bfe22a7ee793d773fb
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_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
6 #define COMPONENTS_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_
8 #include <string>
10 #include "base/basictypes.h"
12 namespace omaha_query_params {
14 class OmahaQueryParamsDelegate;
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
20 // browser process.
21 class OmahaQueryParams {
22 public:
23 enum ProdId {
24 CHROME = 0,
25 CRX,
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();
51 // Use this delegate.
52 static void SetDelegate(OmahaQueryParamsDelegate* delegate);
54 private:
55 DISALLOW_IMPLICIT_CONSTRUCTORS(OmahaQueryParams);
58 } // namespace omaha_query_params
60 #endif // COMPONENTS_OMAHA_QUERY_PARAMS_OMAHA_QUERY_PARAMS_H_