[M120 Migration][VD] Enable direct rendering for TVPlus
[platform/framework/web/chromium-efl.git] / components / component_updater / configurator_impl.h
1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_
6 #define COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "base/containers/flat_map.h"
13 #include "base/time/time.h"
14 #include "components/update_client/configurator.h"
15 #include "third_party/abseil-cpp/absl/types/optional.h"
16 #include "url/gurl.h"
17
18 namespace base {
19 class Version;
20 }
21
22 namespace update_client {
23 class CommandLineConfigPolicy;
24 class ProtocolHandlerFactory;
25 }  // namespace update_client
26
27 namespace component_updater {
28
29 // Helper class for the implementations of update_client::Configurator.
30 // Can be used both on iOS and other platforms.
31 class ConfiguratorImpl {
32  public:
33   ConfiguratorImpl(const update_client::CommandLineConfigPolicy& config_policy,
34                    bool require_encryption);
35
36   ConfiguratorImpl(const ConfiguratorImpl&) = delete;
37   ConfiguratorImpl& operator=(const ConfiguratorImpl&) = delete;
38
39   ~ConfiguratorImpl();
40
41   // Delay from calling Start() to the first update check.
42   base::TimeDelta InitialDelay() const;
43
44   // Delay to every subsequent update check. 0 means don't check.
45   base::TimeDelta NextCheckDelay() const;
46
47   // Minimum delta time before an on-demand check is allowed for the same
48   // component.
49   base::TimeDelta OnDemandDelay() const;
50
51   // The time delay between applying updates for different components.
52   base::TimeDelta UpdateDelay() const;
53
54   // The URLs for the update checks. The URLs are tried in order, the first one
55   // that succeeds wins.
56   std::vector<GURL> UpdateUrl() const;
57
58   // The URLs for pings. Returns an empty vector if and only if pings are
59   // disabled. Similarly, these URLs have a fall back behavior too.
60   std::vector<GURL> PingUrl() const;
61
62   // Version of the application. Used to compare the component manifests.
63   const base::Version& GetBrowserVersion() const;
64
65   // Returns the OS's long name like "Windows", "Mac OS X", etc.
66   std::string GetOSLongName() const;
67
68   // Parameters added to each url request. It can be empty if none are needed.
69   // Returns a map of name-value pairs that match ^[-_a-zA-Z0-9]$ regex.
70   base::flat_map<std::string, std::string> ExtraRequestParams() const;
71
72   // Provides a hint for the server to control the order in which multiple
73   // download urls are returned.
74   std::string GetDownloadPreference() const;
75
76   // True means that this client can handle delta updates.
77   bool EnabledDeltas() const;
78
79   // True is the component updates are enabled.
80   bool EnabledComponentUpdates() const;
81
82   // True means that the background downloader can be used for downloading
83   // non on-demand components.
84   bool EnabledBackgroundDownloader() const;
85
86   // True if signing of update checks is enabled.
87   bool EnabledCupSigning() const;
88
89   // Returns the app GUID with which Chrome is registered with Google Update, or
90   // an empty string if this brand does not integrate with Google Update.
91   std::string GetAppGuid() const;
92
93   // Returns the class factory to create protocol parser and protocol
94   // serializer object instances.
95   std::unique_ptr<update_client::ProtocolHandlerFactory>
96   GetProtocolHandlerFactory() const;
97
98   absl::optional<bool> IsMachineExternallyManaged() const;
99
100   update_client::UpdaterStateProvider GetUpdaterStateProvider() const;
101
102  private:
103   base::flat_map<std::string, std::string> extra_info_;
104   const bool background_downloads_enabled_;
105   const bool deltas_enabled_;
106   const bool fast_update_;
107   const bool pings_enabled_;
108   const bool require_encryption_;
109   const GURL url_source_override_;
110   const base::TimeDelta initial_delay_;
111 };
112
113 }  // namespace component_updater
114
115 #endif  // COMPONENTS_COMPONENT_UPDATER_CONFIGURATOR_IMPL_H_