| 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/history/expire_history_backend.h" | 5 #include "chrome/browser/history/expire_history_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 if (!dependencies->deleted_urls.empty()) { | 398 if (!dependencies->deleted_urls.empty()) { |
| 399 // Broadcast the URL deleted notification. Note that we also broadcast when | 399 // Broadcast the URL deleted notification. Note that we also broadcast when |
| 400 // we were requested to delete everything even if that was a NOP, since | 400 // we were requested to delete everything even if that was a NOP, since |
| 401 // some components care to know when history is deleted (it's up to them to | 401 // some components care to know when history is deleted (it's up to them to |
| 402 // determine if they care whether anything was deleted). | 402 // determine if they care whether anything was deleted). |
| 403 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; | 403 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; |
| 404 deleted_details->all_history = false; | 404 deleted_details->all_history = false; |
| 405 deleted_details->archived = (type == DELETION_ARCHIVED); | 405 deleted_details->archived = (type == DELETION_ARCHIVED); |
| 406 deleted_details->rows = dependencies->deleted_urls; | 406 deleted_details->rows = dependencies->deleted_urls; |
| 407 deleted_details->favicon_urls = dependencies->expired_favicons; | 407 deleted_details->favicon_urls = dependencies->expired_favicons; |
| 408 delegate_->NotifySyncURLsDeleted(false, |
| 409 deleted_details->archived, |
| 410 &deleted_details->rows); |
| 408 delegate_->BroadcastNotifications( | 411 delegate_->BroadcastNotifications( |
| 409 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); | 412 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); |
| 410 } | 413 } |
| 411 } | 414 } |
| 412 | 415 |
| 413 void ExpireHistoryBackend::DeleteVisitRelatedInfo( | 416 void ExpireHistoryBackend::DeleteVisitRelatedInfo( |
| 414 const VisitVector& visits, | 417 const VisitVector& visits, |
| 415 DeleteDependencies* dependencies) { | 418 DeleteDependencies* dependencies) { |
| 416 for (size_t i = 0; i < visits.size(); i++) { | 419 for (size_t i = 0; i < visits.size(); i++) { |
| 417 // Delete the visit itself. | 420 // Delete the visit itself. |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 // We use the bookmark service to determine if a URL is bookmarked. The | 769 // We use the bookmark service to determine if a URL is bookmarked. The |
| 767 // bookmark service is loaded on a separate thread and may not be done by the | 770 // bookmark service is loaded on a separate thread and may not be done by the |
| 768 // time we get here. We therefor block until the bookmarks have finished | 771 // time we get here. We therefor block until the bookmarks have finished |
| 769 // loading. | 772 // loading. |
| 770 if (bookmark_service_) | 773 if (bookmark_service_) |
| 771 bookmark_service_->BlockTillLoaded(); | 774 bookmark_service_->BlockTillLoaded(); |
| 772 return bookmark_service_; | 775 return bookmark_service_; |
| 773 } | 776 } |
| 774 | 777 |
| 775 } // namespace history | 778 } // namespace history |
| OLD | NEW |