| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/component_updater/component_updater_service_observer.h" |
| 6 #include "chrome/browser/component_updater/crx_update_item.h" |
| 7 #include "chrome/browser/component_updater/ping_sender.h" |
| 8 |
| 9 namespace component_updater { |
| 10 |
| 11 ComponentUpdaterServiceObserver::ComponentUpdaterServiceObserver( |
| 12 ComponentUpdateService::Configurator* config) |
| 13 : config_(config) { |
| 14 } |
| 15 |
| 16 ComponentUpdaterServiceObserver::~ComponentUpdaterServiceObserver() { |
| 17 } |
| 18 |
| 19 // Sends a fire and forget ping when the updates are complete. The ping |
| 20 // sender object self-deletes after sending the ping. |
| 21 void ComponentUpdaterServiceObserver::OnEvent(Events event, |
| 22 const CrxUpdateItem* item) { |
| 23 if (event == kEventUpdateComplete) { |
| 24 component_updater::PingSender* ping_sender(new PingSender(config_)); |
| 25 ping_sender->SendPing(item); |
| 26 } |
| 27 } |
| 28 |
| 29 } // namespace component_updater |
| 30 |
| OLD | NEW |