| 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 "components/history/core/browser/history_backend.h" | 5 #include "components/history/core/browser/history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 2474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2485 void HistoryBackend::NotifyFaviconsChanged(const std::set<GURL>& page_urls, | 2485 void HistoryBackend::NotifyFaviconsChanged(const std::set<GURL>& page_urls, |
| 2486 const GURL& icon_url) { | 2486 const GURL& icon_url) { |
| 2487 if (delegate_) | 2487 if (delegate_) |
| 2488 delegate_->NotifyFaviconsChanged(page_urls, icon_url); | 2488 delegate_->NotifyFaviconsChanged(page_urls, icon_url); |
| 2489 } | 2489 } |
| 2490 | 2490 |
| 2491 void HistoryBackend::NotifyURLVisited(ui::PageTransition transition, | 2491 void HistoryBackend::NotifyURLVisited(ui::PageTransition transition, |
| 2492 const URLRow& row, | 2492 const URLRow& row, |
| 2493 const RedirectList& redirects, | 2493 const RedirectList& redirects, |
| 2494 base::Time visit_time) { | 2494 base::Time visit_time) { |
| 2495 FOR_EACH_OBSERVER(HistoryBackendObserver, observers_, | 2495 for (HistoryBackendObserver& observer : observers_) |
| 2496 OnURLVisited(this, transition, row, redirects, visit_time)); | 2496 observer.OnURLVisited(this, transition, row, redirects, visit_time); |
| 2497 | 2497 |
| 2498 if (delegate_) | 2498 if (delegate_) |
| 2499 delegate_->NotifyURLVisited(transition, row, redirects, visit_time); | 2499 delegate_->NotifyURLVisited(transition, row, redirects, visit_time); |
| 2500 } | 2500 } |
| 2501 | 2501 |
| 2502 void HistoryBackend::NotifyURLsModified(const URLRows& rows) { | 2502 void HistoryBackend::NotifyURLsModified(const URLRows& rows) { |
| 2503 FOR_EACH_OBSERVER(HistoryBackendObserver, observers_, | 2503 for (HistoryBackendObserver& observer : observers_) |
| 2504 OnURLsModified(this, rows)); | 2504 observer.OnURLsModified(this, rows); |
| 2505 | 2505 |
| 2506 if (delegate_) | 2506 if (delegate_) |
| 2507 delegate_->NotifyURLsModified(rows); | 2507 delegate_->NotifyURLsModified(rows); |
| 2508 } | 2508 } |
| 2509 | 2509 |
| 2510 void HistoryBackend::NotifyURLsDeleted(bool all_history, | 2510 void HistoryBackend::NotifyURLsDeleted(bool all_history, |
| 2511 bool expired, | 2511 bool expired, |
| 2512 const URLRows& rows, | 2512 const URLRows& rows, |
| 2513 const std::set<GURL>& favicon_urls) { | 2513 const std::set<GURL>& favicon_urls) { |
| 2514 URLRows copied_rows(rows); | 2514 URLRows copied_rows(rows); |
| 2515 FOR_EACH_OBSERVER( | 2515 for (HistoryBackendObserver& observer : observers_) { |
| 2516 HistoryBackendObserver, observers_, | 2516 observer.OnURLsDeleted(this, all_history, expired, copied_rows, |
| 2517 OnURLsDeleted(this, all_history, expired, copied_rows, favicon_urls)); | 2517 favicon_urls); |
| 2518 } |
| 2518 | 2519 |
| 2519 if (delegate_) | 2520 if (delegate_) |
| 2520 delegate_->NotifyURLsDeleted(all_history, expired, copied_rows, | 2521 delegate_->NotifyURLsDeleted(all_history, expired, copied_rows, |
| 2521 favicon_urls); | 2522 favicon_urls); |
| 2522 } | 2523 } |
| 2523 | 2524 |
| 2524 // Deleting -------------------------------------------------------------------- | 2525 // Deleting -------------------------------------------------------------------- |
| 2525 | 2526 |
| 2526 void HistoryBackend::DeleteAllHistory() { | 2527 void HistoryBackend::DeleteAllHistory() { |
| 2527 // Our approach to deleting all history is: | 2528 // Our approach to deleting all history is: |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2640 // transaction is currently open. | 2641 // transaction is currently open. |
| 2641 db_->CommitTransaction(); | 2642 db_->CommitTransaction(); |
| 2642 db_->Vacuum(); | 2643 db_->Vacuum(); |
| 2643 db_->BeginTransaction(); | 2644 db_->BeginTransaction(); |
| 2644 db_->GetStartDate(&first_recorded_time_); | 2645 db_->GetStartDate(&first_recorded_time_); |
| 2645 | 2646 |
| 2646 return true; | 2647 return true; |
| 2647 } | 2648 } |
| 2648 | 2649 |
| 2649 } // namespace history | 2650 } // namespace history |
| OLD | NEW |