blob: e315e144cf1cbb62a0840938dbfb60b3ee0b5fb7 [file] [log] [blame]
[email protected]8f4b69e2014-06-26 00:01:311// 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.
4
sorin39eab2f2015-01-06 01:09:085#ifndef COMPONENTS_UPDATE_CLIENT_UPDATE_QUERY_PARAMS_H_
6#define COMPONENTS_UPDATE_CLIENT_UPDATE_QUERY_PARAMS_H_
[email protected]8f4b69e2014-06-26 00:01:317
8#include <string>
9
avi5dd91f82015-12-25 22:30:4610#include "base/macros.h"
[email protected]8f4b69e2014-06-26 00:01:3111
sorin39eab2f2015-01-06 01:09:0812namespace update_client {
[email protected]8f4b69e2014-06-26 00:01:3113
sorin39eab2f2015-01-06 01:09:0814class UpdateQueryParamsDelegate;
[email protected]8f4b69e2014-06-26 00:01:3115
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.
sorin39eab2f2015-01-06 01:09:0821class UpdateQueryParams {
[email protected]8f4b69e2014-06-26 00:01:3122 public:
23 enum ProdId {
24 CHROME = 0,
25 CRX,
26 };
27
28 // Generates a string of URL query parameters for Omaha. Includes the
[email protected]a97fa552014-07-10 03:45:4529 // following fields: "os", "arch", "nacl_arch", "prod", "prodchannel",
30 // "prodversion", and "lang"
[email protected]8f4b69e2014-06-26 00:01:3131 static std::string Get(ProdId prod);
32
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);
36
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();
40
41 // Returns the value we use for the "arch=" parameter. Possible return values
42 // include: "x86", "x64", and "arm".
43 static const char* GetArch();
44
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",
Shawn Anastasio0daeebc2019-03-20 22:31:4148 // "arm", "mips32", and "ppc64".
[email protected]8f4b69e2014-06-26 00:01:3149 static const char* GetNaclArch();
50
mxnguyenb76476192017-04-03 17:54:1451 // Returns the current version of Chrome/Chromium.
52 static std::string GetProdVersion();
53
[email protected]8f4b69e2014-06-26 00:01:3154 // Use this delegate.
sorin39eab2f2015-01-06 01:09:0855 static void SetDelegate(UpdateQueryParamsDelegate* delegate);
[email protected]8f4b69e2014-06-26 00:01:3156
57 private:
sorin39eab2f2015-01-06 01:09:0858 DISALLOW_IMPLICIT_CONSTRUCTORS(UpdateQueryParams);
[email protected]8f4b69e2014-06-26 00:01:3159};
60
sorin39eab2f2015-01-06 01:09:0861} // namespace update_client
[email protected]8f4b69e2014-06-26 00:01:3162
sorin39eab2f2015-01-06 01:09:0863#endif // COMPONENTS_UPDATE_CLIENT_UPDATE_QUERY_PARAMS_H_