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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 334 |
335 void ExpireHistoryBackend::BroadcastDeleteNotifications( | 335 void ExpireHistoryBackend::BroadcastDeleteNotifications( |
336 DeleteDependencies* dependencies) { | 336 DeleteDependencies* dependencies) { |
337 if (!dependencies->deleted_urls.empty()) { | 337 if (!dependencies->deleted_urls.empty()) { |
338 // Broadcast the URL deleted notification. Note that we also broadcast when | 338 // Broadcast the URL deleted notification. Note that we also broadcast when |
339 // we were requested to delete everything even if that was a NOP, since | 339 // we were requested to delete everything even if that was a NOP, since |
340 // some components care to know when history is deleted (it's up to them to | 340 // some components care to know when history is deleted (it's up to them to |
341 // determine if they care whether anything was deleted). | 341 // determine if they care whether anything was deleted). |
342 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; | 342 URLsDeletedDetails* deleted_details = new URLsDeletedDetails; |
343 deleted_details->all_history = false; | 343 deleted_details->all_history = false; |
344 std::vector<URLRow> typed_urls_changed; // Collect this for later. | |
345 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) { | 344 for (size_t i = 0; i < dependencies->deleted_urls.size(); i++) { |
| 345 deleted_details->rows.push_back(dependencies->deleted_urls[i]); |
346 deleted_details->urls.insert(dependencies->deleted_urls[i].url()); | 346 deleted_details->urls.insert(dependencies->deleted_urls[i].url()); |
347 if (dependencies->deleted_urls[i].typed_count() > 0) | |
348 typed_urls_changed.push_back(dependencies->deleted_urls[i]); | |
349 } | 347 } |
350 delegate_->BroadcastNotifications( | 348 delegate_->BroadcastNotifications( |
351 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); | 349 chrome::NOTIFICATION_HISTORY_URLS_DELETED, deleted_details); |
352 } | 350 } |
353 } | 351 } |
354 | 352 |
355 void ExpireHistoryBackend::DeleteVisitRelatedInfo( | 353 void ExpireHistoryBackend::DeleteVisitRelatedInfo( |
356 const VisitVector& visits, | 354 const VisitVector& visits, |
357 DeleteDependencies* dependencies) { | 355 DeleteDependencies* dependencies) { |
358 for (size_t i = 0; i < visits.size(); i++) { | 356 for (size_t i = 0; i < visits.size(); i++) { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 // We use the bookmark service to determine if a URL is bookmarked. The | 699 // We use the bookmark service to determine if a URL is bookmarked. The |
702 // bookmark service is loaded on a separate thread and may not be done by the | 700 // bookmark service is loaded on a separate thread and may not be done by the |
703 // time we get here. We therefor block until the bookmarks have finished | 701 // time we get here. We therefor block until the bookmarks have finished |
704 // loading. | 702 // loading. |
705 if (bookmark_service_) | 703 if (bookmark_service_) |
706 bookmark_service_->BlockTillLoaded(); | 704 bookmark_service_->BlockTillLoaded(); |
707 return bookmark_service_; | 705 return bookmark_service_; |
708 } | 706 } |
709 | 707 |
710 } // namespace history | 708 } // namespace history |
OLD | NEW |