OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 "components/ukm/observers/history_delete_observer.h" |
| 6 |
| 7 #include "components/history/core/browser/history_service.h" |
| 8 |
| 9 namespace ukm { |
| 10 |
| 11 HistoryDeleteObserver::HistoryDeleteObserver() : history_observer_(this) {} |
| 12 |
| 13 HistoryDeleteObserver::~HistoryDeleteObserver() {} |
| 14 |
| 15 void HistoryDeleteObserver::ObserveServiceForDeletions( |
| 16 history::HistoryService* history_service) { |
| 17 if (history_service) { |
| 18 history_observer_.Add(history_service); |
| 19 } |
| 20 } |
| 21 |
| 22 void HistoryDeleteObserver::OnURLsDeleted( |
| 23 history::HistoryService* history_service, |
| 24 bool all_history, |
| 25 bool expired, |
| 26 const history::URLRows& deleted_rows, |
| 27 const std::set<GURL>& favicon_urls) { |
| 28 if (!expired) |
| 29 OnHistoryDeleted(); |
| 30 } |
| 31 |
| 32 void HistoryDeleteObserver::HistoryServiceBeingDeleted( |
| 33 history::HistoryService* history_service) { |
| 34 history_observer_.Remove(history_service); |
| 35 } |
| 36 |
| 37 } // namespace ukm |
OLD | NEW |