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 <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 break; | 977 break; |
978 default: | 978 default: |
979 event = Configurator::kUnpackError; | 979 event = Configurator::kUnpackError; |
980 break; | 980 break; |
981 } | 981 } |
982 | 982 |
983 config_->OnEvent(event, CrxIdtoUMAId(component_id)); | 983 config_->OnEvent(event, CrxIdtoUMAId(component_id)); |
984 ScheduleNextRun(false); | 984 ScheduleNextRun(false); |
985 } | 985 } |
986 | 986 |
| 987 bool ComponentUpdateService::IsUpdateNotificationForComponent( |
| 988 const content::NotificationSource& src, |
| 989 const CrxComponent& component) { |
| 990 std::string id = |
| 991 HexStringToID(StringToLowerASCII(base::HexEncode(&component.pk_hash[0], |
| 992 component.pk_hash.size()/2))); |
| 993 return content::Source<std::string>(src)->compare(id) == 0; |
| 994 } |
| 995 |
987 // The component update factory. Using the component updater as a singleton | 996 // The component update factory. Using the component updater as a singleton |
988 // is the job of the browser process. | 997 // is the job of the browser process. |
989 ComponentUpdateService* ComponentUpdateServiceFactory( | 998 ComponentUpdateService* ComponentUpdateServiceFactory( |
990 ComponentUpdateService::Configurator* config) { | 999 ComponentUpdateService::Configurator* config) { |
991 DCHECK(config); | 1000 DCHECK(config); |
992 return new CrxUpdateService(config); | 1001 return new CrxUpdateService(config); |
993 } | 1002 } |
OLD | NEW |