OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ | 5 #ifndef EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ |
6 #define EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ | 6 #define EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 : rollcall_days(rollcall), | 67 : rollcall_days(rollcall), |
68 active_days(active), | 68 active_days(active), |
69 is_enabled(enabled), | 69 is_enabled(enabled), |
70 disable_reasons(reasons) {} | 70 disable_reasons(reasons) {} |
71 }; | 71 }; |
72 | 72 |
73 ManifestFetchData(const GURL& update_url, | 73 ManifestFetchData(const GURL& update_url, |
74 int request_id, | 74 int request_id, |
75 const std::string& brand_code, | 75 const std::string& brand_code, |
76 const std::string& base_query_params, | 76 const std::string& base_query_params, |
77 PingMode ping_mode); | 77 PingMode ping_mode, |
| 78 bool on_demand_update); |
78 ~ManifestFetchData(); | 79 ~ManifestFetchData(); |
79 | 80 |
80 // Returns true if this extension information was successfully added. If the | 81 // Returns true if this extension information was successfully added. If the |
81 // return value is false it means the full_url would have become too long, and | 82 // return value is false it means the full_url would have become too long or |
| 83 // the request type is not compatible the current request type, and |
82 // this ManifestFetchData object remains unchanged. | 84 // this ManifestFetchData object remains unchanged. |
83 bool AddExtension(const std::string& id, | 85 bool AddExtension(const std::string& id, |
84 const std::string& version, | 86 const std::string& version, |
85 const PingData* ping_data, | 87 const PingData* ping_data, |
86 const std::string& update_url_data, | 88 const std::string& update_url_data, |
87 const std::string& install_source); | 89 const std::string& install_source, |
| 90 bool on_demand_update); |
88 | 91 |
89 const GURL& base_url() const { return base_url_; } | 92 const GURL& base_url() const { return base_url_; } |
90 const GURL& full_url() const { return full_url_; } | 93 const GURL& full_url() const { return full_url_; } |
91 const std::set<std::string>& extension_ids() const { return extension_ids_; } | 94 const std::set<std::string>& extension_ids() const { return extension_ids_; } |
92 const std::set<int>& request_ids() const { return request_ids_; } | 95 const std::set<int>& request_ids() const { return request_ids_; } |
| 96 bool on_demand_update() const { return on_demand_update_; } |
93 | 97 |
94 // Returns true if the given id is included in this manifest fetch. | 98 // Returns true if the given id is included in this manifest fetch. |
95 bool Includes(const std::string& extension_id) const; | 99 bool Includes(const std::string& extension_id) const; |
96 | 100 |
97 // Returns true if a ping parameter for |type| was added to full_url for this | 101 // Returns true if a ping parameter for |type| was added to full_url for this |
98 // extension id. | 102 // extension id. |
99 bool DidPing(const std::string& extension_id, PingType type) const; | 103 bool DidPing(const std::string& extension_id, PingType type) const; |
100 | 104 |
101 // Assuming that both this ManifestFetchData and |other| have the same | 105 // Assuming that both this ManifestFetchData and |other| have the same |
102 // full_url, this method merges the other information associated with the | 106 // full_url, this method merges the other information associated with the |
(...skipping 22 matching lines...) Expand all Loading... |
125 std::set<int> request_ids_; | 129 std::set<int> request_ids_; |
126 | 130 |
127 // The brand code to include with manifest fetch queries, if non-empty and | 131 // The brand code to include with manifest fetch queries, if non-empty and |
128 // |ping_mode_| >= PING. | 132 // |ping_mode_| >= PING. |
129 const std::string brand_code_; | 133 const std::string brand_code_; |
130 | 134 |
131 // The ping mode for this fetch. This determines whether or not ping data | 135 // The ping mode for this fetch. This determines whether or not ping data |
132 // (and possibly extra metrics) will be included in the fetch query. | 136 // (and possibly extra metrics) will be included in the fetch query. |
133 const PingMode ping_mode_; | 137 const PingMode ping_mode_; |
134 | 138 |
| 139 // If true, this is an on-demand update. |
| 140 bool on_demand_update_; |
| 141 |
135 DISALLOW_COPY_AND_ASSIGN(ManifestFetchData); | 142 DISALLOW_COPY_AND_ASSIGN(ManifestFetchData); |
136 }; | 143 }; |
137 | 144 |
138 } // namespace extensions | 145 } // namespace extensions |
139 | 146 |
140 #endif // EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ | 147 #endif // EXTENSIONS_BROWSER_UPDATER_MANIFEST_FETCH_DATA_H_ |
OLD | NEW |