| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/component_updater/component_updater_service.h" | 5 #include "chrome/browser/component_updater/component_updater_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/win/windows_version.h" |
| 15 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/chrome_version_info.h" | 18 #include "chrome/common/chrome_version_info.h" |
| 18 #include "net/url_request/url_request_context_getter.h" | 19 #include "net/url_request/url_request_context_getter.h" |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 // Default time constants. | 22 // Default time constants. |
| 22 const int kDelayOneMinute = 60; | 23 const int kDelayOneMinute = 60; |
| 23 const int kDelayOneHour = kDelayOneMinute * 60; | 24 const int kDelayOneHour = kDelayOneMinute * 60; |
| 24 | 25 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) { | 137 if (cmdline->HasSwitch(switches::kAppsGalleryUpdateURL)) { |
| 137 app_update_url_ = | 138 app_update_url_ = |
| 138 GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); | 139 GURL(cmdline->GetSwitchValueASCII(switches::kAppsGalleryUpdateURL)); |
| 139 } else { | 140 } else { |
| 140 app_update_url_ = GURL("http://clients2.google.com/service/update2/crx"); | 141 app_update_url_ = GURL("http://clients2.google.com/service/update2/crx"); |
| 141 } | 142 } |
| 142 | 143 |
| 143 // Make the extra request params, they are necessary so omaha does | 144 // Make the extra request params, they are necessary so omaha does |
| 144 // not deliver components that are going to be rejected at install time. | 145 // not deliver components that are going to be rejected at install time. |
| 145 extra_info_ += chrome::VersionInfo().Version(); | 146 extra_info_ += chrome::VersionInfo().Version(); |
| 147 #if defined(OS_WIN) |
| 148 if (base::win::OSInfo::GetInstance()->wow64_status() == |
| 149 base::win::OSInfo::WOW64_ENABLED) |
| 150 extra_info_ += "&wow64=1"; |
| 151 #endif |
| 146 if (HasDebugValue(debug_values, kDebugRequestParam)) | 152 if (HasDebugValue(debug_values, kDebugRequestParam)) |
| 147 extra_info_ += "&testrequest=1"; | 153 extra_info_ += "&testrequest=1"; |
| 148 } | 154 } |
| 149 | 155 |
| 150 int ChromeConfigurator::InitialDelay() { | 156 int ChromeConfigurator::InitialDelay() { |
| 151 return fast_update_ ? 1 : (6 * kDelayOneMinute); | 157 return fast_update_ ? 1 : (6 * kDelayOneMinute); |
| 152 } | 158 } |
| 153 | 159 |
| 154 int ChromeConfigurator::NextCheckDelay() { | 160 int ChromeConfigurator::NextCheckDelay() { |
| 155 return fast_update_ ? 3 : (1 * kDelayOneHour); | 161 return fast_update_ ? 3 : (1 * kDelayOneHour); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 default: | 212 default: |
| 207 NOTREACHED(); | 213 NOTREACHED(); |
| 208 break; | 214 break; |
| 209 } | 215 } |
| 210 } | 216 } |
| 211 | 217 |
| 212 ComponentUpdateService::Configurator* MakeChromeComponentUpdaterConfigurator( | 218 ComponentUpdateService::Configurator* MakeChromeComponentUpdaterConfigurator( |
| 213 const CommandLine* cmdline, net::URLRequestContextGetter* context_getter) { | 219 const CommandLine* cmdline, net::URLRequestContextGetter* context_getter) { |
| 214 return new ChromeConfigurator(cmdline, context_getter); | 220 return new ChromeConfigurator(cmdline, context_getter); |
| 215 } | 221 } |
| OLD | NEW |