OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 344 |
345 void ExpireHistoryBackend::BroadcastDeleteNotifications( | 345 void ExpireHistoryBackend::BroadcastDeleteNotifications( |
346 DeleteDependencies* dependencies) { | 346 DeleteDependencies* dependencies) { |
347 if (!dependencies->deleted_urls.empty()) { | 347 if (!dependencies->deleted_urls.empty()) { |
348 // Broadcast the URL deleted notification. Note that we also broadcast when | 348 // Broadcast the URL deleted notification. Note that we also broadcast when |
349 // we were requested to delete everything even if that was a NOP, since | 349 // we were requested to delete everything even if that was a NOP, since |
350 // some components care to know when history is deleted (it's up to them to | 350 // some components care to know when history is deleted (it's up to them to |
351 // determine if they care whether anything was deleted). | 351 // determine if they care whether anything was deleted). |
352 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; | 352 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; |
353 deleted_details->all_history = false; | 353 deleted_details->all_history = false; |
354 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) { | 354 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) |
355 deleted_details->rows.push_back(dependencies->deleted_urls[i]); | |
356 deleted_details->urls.insert(dependencies->deleted_urls[i].url()); | 355 deleted_details->urls.insert(dependencies->deleted_urls[i].url()); |
357 } | |
358 delegate_->BroadcastNotifications( | 356 delegate_->BroadcastNotifications( |
359 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); | 357 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); |
360 } | 358 } |
361 } | 359 } |
362 | 360 |
363 void ExpireHistoryBackend::DeleteVisitRelatedInfo( | 361 void ExpireHistoryBackend::DeleteVisitRelatedInfo( |
364 const VisitVector& visits, | 362 const VisitVector& visits, |
365 DeleteDependencies* dependencies) { | 363 DeleteDependencies* dependencies) { |
366 for (size_t i = 0; i < visits.size(); i++) { | 364 for (size_t i = 0; i < visits.size(); i++) { |
367 // Delete the visit itself. | 365 // Delete the visit itself. |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 // We use the bookmark service to determine if a URL is bookmarked. The | 707 // We use the bookmark service to determine if a URL is bookmarked. The |
710 // bookmark service is loaded on a separate thread and may not be done by the | 708 // bookmark service is loaded on a separate thread and may not be done by the |
711 // time we get here. We therefor block until the bookmarks have finished | 709 // time we get here. We therefor block until the bookmarks have finished |
712 // loading. | 710 // loading. |
713 if (bookmark_service_) | 711 if (bookmark_service_) |
714 bookmark_service_->BlockTillLoaded(); | 712 bookmark_service_->BlockTillLoaded(); |
715 return bookmark_service_; | 713 return bookmark_service_; |
716 } | 714 } |
717 | 715 |
718 } // namespace history | 716 } // namespace history |
OLD | NEW |