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 <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 352 |
353 void ExpireHistoryBackend::BroadcastDeleteNotifications( | 353 void ExpireHistoryBackend::BroadcastDeleteNotifications( |
354 DeleteDependencies* dependencies) { | 354 DeleteDependencies* dependencies) { |
355 if (!dependencies->deleted_urls.empty()) { | 355 if (!dependencies->deleted_urls.empty()) { |
356 // Broadcast the URL deleted notification. Note that we also broadcast when | 356 // Broadcast the URL deleted notification. Note that we also broadcast when |
357 // we were requested to delete everything even if that was a NOP, since | 357 // we were requested to delete everything even if that was a NOP, since |
358 // some components care to know when history is deleted (it's up to them to | 358 // some components care to know when history is deleted (it's up to them to |
359 // determine if they care whether anything was deleted). | 359 // determine if they care whether anything was deleted). |
360 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; | 360 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; |
361 deleted_details->all_history = false; | 361 deleted_details->all_history = false; |
362 deleted_details->rows = dependencies->deleted_urls; | 362 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) |
| 363 deleted_details->urls.insert(dependencies->deleted_urls[i].url()); |
363 delegate_->BroadcastNotifications( | 364 delegate_->BroadcastNotifications( |
364 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); | 365 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); |
365 } | 366 } |
366 } | 367 } |
367 | 368 |
368 void ExpireHistoryBackend::DeleteVisitRelatedInfo( | 369 void ExpireHistoryBackend::DeleteVisitRelatedInfo( |
369 const VisitVector& visits, | 370 const VisitVector& visits, |
370 DeleteDependencies* dependencies) { | 371 DeleteDependencies* dependencies) { |
371 for (size_t i = 0; i < visits.size(); i++) { | 372 for (size_t i = 0; i < visits.size(); i++) { |
372 // Delete the visit itself. | 373 // Delete the visit itself. |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 // We use the bookmark service to determine if a URL is bookmarked. The | 715 // We use the bookmark service to determine if a URL is bookmarked. The |
715 // bookmark service is loaded on a separate thread and may not be done by the | 716 // bookmark service is loaded on a separate thread and may not be done by the |
716 // time we get here. We therefor block until the bookmarks have finished | 717 // time we get here. We therefor block until the bookmarks have finished |
717 // loading. | 718 // loading. |
718 if (bookmark_service_) | 719 if (bookmark_service_) |
719 bookmark_service_->BlockTillLoaded(); | 720 bookmark_service_->BlockTillLoaded(); |
720 return bookmark_service_; | 721 return bookmark_service_; |
721 } | 722 } |
722 | 723 |
723 } // namespace history | 724 } // namespace history |
OLD | NEW |