OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/extensions/extension_updater.h" | 5 #include "chrome/browser/extensions/extension_updater.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 void ManifestFetchesBuilder::AddPendingExtension( | 176 void ManifestFetchesBuilder::AddPendingExtension( |
177 const std::string& id, | 177 const std::string& id, |
178 const PendingExtensionInfo& info) { | 178 const PendingExtensionInfo& info) { |
179 // Use a zero version to ensure that a pending extension will always | 179 // Use a zero version to ensure that a pending extension will always |
180 // be updated, and thus installed (assuming all extensions have | 180 // be updated, and thus installed (assuming all extensions have |
181 // non-zero versions). | 181 // non-zero versions). |
182 scoped_ptr<Version> version( | 182 scoped_ptr<Version> version( |
183 Version::GetVersionFromString("0.0.0.0")); | 183 Version::GetVersionFromString("0.0.0.0")); |
184 | 184 |
185 Extension::Location location = | 185 AddExtensionData(info.install_source, id, *version, |
186 (info.is_from_sync ? Extension::INTERNAL | |
187 : Extension::EXTERNAL_PREF_DOWNLOAD); | |
188 | |
189 AddExtensionData(location, id, *version, | |
190 info.expected_crx_type, info.update_url); | 186 info.expected_crx_type, info.update_url); |
191 } | 187 } |
192 | 188 |
193 void ManifestFetchesBuilder::ReportStats() const { | 189 void ManifestFetchesBuilder::ReportStats() const { |
194 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtensions", | 190 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckExtensions", |
195 url_stats_.google_url_count + | 191 url_stats_.google_url_count + |
196 url_stats_.other_url_count - | 192 url_stats_.other_url_count - |
197 url_stats_.theme_count); | 193 url_stats_.theme_count); |
198 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", | 194 UMA_HISTOGRAM_COUNTS_100("Extensions.UpdateCheckTheme", |
199 url_stats_.theme_count); | 195 url_stats_.theme_count); |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 extension_fetcher_.reset( | 848 extension_fetcher_.reset( |
853 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); | 849 URLFetcher::Create(kExtensionFetcherId, url, URLFetcher::GET, this)); |
854 extension_fetcher_->set_request_context( | 850 extension_fetcher_->set_request_context( |
855 Profile::GetDefaultRequestContext()); | 851 Profile::GetDefaultRequestContext()); |
856 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | | 852 extension_fetcher_->set_load_flags(net::LOAD_DO_NOT_SEND_COOKIES | |
857 net::LOAD_DO_NOT_SAVE_COOKIES); | 853 net::LOAD_DO_NOT_SAVE_COOKIES); |
858 extension_fetcher_->Start(); | 854 extension_fetcher_->Start(); |
859 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); | 855 current_extension_fetch_ = ExtensionFetch(id, url, hash, version); |
860 } | 856 } |
861 } | 857 } |
OLD | NEW |