| 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 #include "components/component_updater/configurator_impl.h" | 5 #include "components/component_updater/configurator_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // Disables pings. Pings are the requests sent to the update server that report | 38 // Disables pings. Pings are the requests sent to the update server that report |
| 39 // the success or the failure of component install or update attempts. | 39 // the success or the failure of component install or update attempts. |
| 40 extern const char kSwitchDisablePings[] = "disable-pings"; | 40 extern const char kSwitchDisablePings[] = "disable-pings"; |
| 41 | 41 |
| 42 // Sets the URL for updates. | 42 // Sets the URL for updates. |
| 43 const char kSwitchUrlSource[] = "url-source"; | 43 const char kSwitchUrlSource[] = "url-source"; |
| 44 | 44 |
| 45 // Disables differential updates. | 45 // Disables differential updates. |
| 46 const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates"; | 46 const char kSwitchDisableDeltaUpdates[] = "disable-delta-updates"; |
| 47 | 47 |
| 48 #if defined(OS_WIN) | |
| 49 // Disables background downloads. | |
| 50 const char kSwitchDisableBackgroundDownloads[] = "disable-background-downloads"; | |
| 51 #endif // defined(OS_WIN) | |
| 52 | |
| 53 // Returns true if and only if |test| is contained in |vec|. | 48 // Returns true if and only if |test| is contained in |vec|. |
| 54 bool HasSwitchValue(const std::vector<std::string>& vec, const char* test) { | 49 bool HasSwitchValue(const std::vector<std::string>& vec, const char* test) { |
| 55 if (vec.empty()) | 50 if (vec.empty()) |
| 56 return 0; | 51 return 0; |
| 57 return (std::find(vec.begin(), vec.end(), test) != vec.end()); | 52 return (std::find(vec.begin(), vec.end(), test) != vec.end()); |
| 58 } | 53 } |
| 59 | 54 |
| 60 // Returns true if falling back on an alternate, unsafe, service URL is | 55 // Returns true if falling back on an alternate, unsafe, service URL is |
| 61 // allowed. In the fallback case, the security of the component update relies | 56 // allowed. In the fallback case, the security of the component update relies |
| 62 // only on the integrity of the CRX payloads, which is self-validating. | 57 // only on the integrity of the CRX payloads, which is self-validating. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 182 |
| 188 bool ConfiguratorImpl::UseBackgroundDownloader() const { | 183 bool ConfiguratorImpl::UseBackgroundDownloader() const { |
| 189 return background_downloads_enabled_; | 184 return background_downloads_enabled_; |
| 190 } | 185 } |
| 191 | 186 |
| 192 void ConfiguratorImpl::set_enable_alt_source_url(bool enable_alt_source_url) { | 187 void ConfiguratorImpl::set_enable_alt_source_url(bool enable_alt_source_url) { |
| 193 fallback_to_alt_source_url_enabled_ = enable_alt_source_url; | 188 fallback_to_alt_source_url_enabled_ = enable_alt_source_url; |
| 194 } | 189 } |
| 195 | 190 |
| 196 } // namespace component_updater | 191 } // namespace component_updater |
| OLD | NEW |