OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ | 5 #ifndef CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ |
6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ | 6 #define CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 class GURL; | 10 class GURL; |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 class CommandLine; | 13 class CommandLine; |
| 14 class Version; |
14 } | 15 } |
15 | 16 |
16 namespace net { | 17 namespace net { |
17 class URLRequestContextGetter; | 18 class URLRequestContextGetter; |
18 } | 19 } |
19 | 20 |
20 namespace component_updater { | 21 namespace component_updater { |
21 | 22 |
22 // Controls the component updater behavior. | 23 // Controls the component updater behavior. |
23 class Configurator { | 24 class Configurator { |
(...skipping 22 matching lines...) Expand all Loading... |
46 // for the same component. | 47 // for the same component. |
47 virtual int OnDemandDelay() const = 0; | 48 virtual int OnDemandDelay() const = 0; |
48 | 49 |
49 // The url that is going to be used update checks over Omaha protocol. | 50 // The url that is going to be used update checks over Omaha protocol. |
50 virtual GURL UpdateUrl() const = 0; | 51 virtual GURL UpdateUrl() const = 0; |
51 | 52 |
52 // The url where the completion pings are sent. Invalid if and only if | 53 // The url where the completion pings are sent. Invalid if and only if |
53 // pings are disabled. | 54 // pings are disabled. |
54 virtual GURL PingUrl() const = 0; | 55 virtual GURL PingUrl() const = 0; |
55 | 56 |
| 57 // Version of the application. Used to compare the component manifests. |
| 58 virtual base::Version GetBrowserVersion() const = 0; |
| 59 |
| 60 // Returns the value we use for the "updaterchannel=" and "prodchannel=" |
| 61 // parameters. Possible return values include: "canary", "dev", "beta", and |
| 62 // "stable". |
| 63 virtual std::string GetChannel() const = 0; |
| 64 |
| 65 // Returns the language for the present locale. Possible return values are |
| 66 // standard tags for languages, such as "en", "en-US", "de", "fr", "af", etc. |
| 67 virtual std::string GetLang() const = 0; |
| 68 |
| 69 // Returns the OS's long name like "Windows", "Mac OS X", etc. |
| 70 virtual std::string GetOSLongName() const = 0; |
| 71 |
56 // Parameters added to each url request. It can be empty if none are needed. | 72 // Parameters added to each url request. It can be empty if none are needed. |
57 // The return string must be safe for insertion as an attribute in an | 73 // The return string must be safe for insertion as an attribute in an |
58 // XML element. | 74 // XML element. |
59 virtual std::string ExtraRequestParams() const = 0; | 75 virtual std::string ExtraRequestParams() const = 0; |
60 | 76 |
61 // How big each update request can be. Don't go above 2000. | 77 // How big each update request can be. Don't go above 2000. |
62 virtual size_t UrlSizeLimit() const = 0; | 78 virtual size_t UrlSizeLimit() const = 0; |
63 | 79 |
64 // The source of contexts for all the url requests. | 80 // The source of contexts for all the url requests. |
65 virtual net::URLRequestContextGetter* RequestContext() const = 0; | 81 virtual net::URLRequestContextGetter* RequestContext() const = 0; |
66 | 82 |
67 // True means that all ops are performed in this process. | 83 // True means that all ops are performed in this process. |
68 virtual bool InProcess() const = 0; | 84 virtual bool InProcess() const = 0; |
69 | 85 |
70 // True means that this client can handle delta updates. | 86 // True means that this client can handle delta updates. |
71 virtual bool DeltasEnabled() const = 0; | 87 virtual bool DeltasEnabled() const = 0; |
72 | 88 |
73 // True means that the background downloader can be used for downloading | 89 // True means that the background downloader can be used for downloading |
74 // non on-demand components. | 90 // non on-demand components. |
75 virtual bool UseBackgroundDownloader() const = 0; | 91 virtual bool UseBackgroundDownloader() const = 0; |
76 }; | 92 }; |
77 | 93 |
78 Configurator* MakeChromeComponentUpdaterConfigurator( | 94 Configurator* MakeChromeComponentUpdaterConfigurator( |
79 const base::CommandLine* cmdline, | 95 const base::CommandLine* cmdline, |
80 net::URLRequestContextGetter* context_getter); | 96 net::URLRequestContextGetter* context_getter); |
81 | 97 |
82 } // namespace component_updater | 98 } // namespace component_updater |
83 | 99 |
84 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ | 100 #endif // CHROME_BROWSER_COMPONENT_UPDATER_COMPONENT_UPDATER_CONFIGURATOR_H_ |
OLD | NEW |