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