| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" | 5 #include "ios/chrome/browser/browsing_data/ios_chrome_browsing_data_remover.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 385 |
| 386 void IOSChromeBrowsingDataRemover::NotifyAndDelete() { | 386 void IOSChromeBrowsingDataRemover::NotifyAndDelete() { |
| 387 set_removing(false); | 387 set_removing(false); |
| 388 | 388 |
| 389 // Notify observers. | 389 // Notify observers. |
| 390 IOSChromeBrowsingDataRemover::NotificationDetails details(delete_begin_, | 390 IOSChromeBrowsingDataRemover::NotificationDetails details(delete_begin_, |
| 391 remove_mask_); | 391 remove_mask_); |
| 392 | 392 |
| 393 GetOnBrowsingDataRemovedCallbacks()->Notify(details); | 393 GetOnBrowsingDataRemovedCallbacks()->Notify(details); |
| 394 | 394 |
| 395 FOR_EACH_OBSERVER(Observer, observer_list_, | 395 for (auto& observer : observer_list_) |
| 396 OnIOSChromeBrowsingDataRemoverDone()); | 396 observer.OnIOSChromeBrowsingDataRemoverDone(); |
| 397 | 397 |
| 398 // History requests aren't happy if you delete yourself from the callback. | 398 // History requests aren't happy if you delete yourself from the callback. |
| 399 // As such, we do a delete later. | 399 // As such, we do a delete later. |
| 400 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); | 400 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void IOSChromeBrowsingDataRemover::NotifyAndDeleteIfDone() { | 403 void IOSChromeBrowsingDataRemover::NotifyAndDeleteIfDone() { |
| 404 // TODO(brettw) http://crbug.com/305259: This should also observe session | 404 // TODO(brettw) http://crbug.com/305259: This should also observe session |
| 405 // clearing (what about other things such as passwords, etc.?) and wait for | 405 // clearing (what about other things such as passwords, etc.?) and wait for |
| 406 // them to complete before continuing. | 406 // them to complete before continuing. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 waiting_for_clear_autofill_origin_urls_ = false; | 503 waiting_for_clear_autofill_origin_urls_ = false; |
| 504 NotifyAndDeleteIfDone(); | 504 NotifyAndDeleteIfDone(); |
| 505 } | 505 } |
| 506 | 506 |
| 507 // static | 507 // static |
| 508 IOSChromeBrowsingDataRemover::CallbackSubscription | 508 IOSChromeBrowsingDataRemover::CallbackSubscription |
| 509 IOSChromeBrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( | 509 IOSChromeBrowsingDataRemover::RegisterOnBrowsingDataRemovedCallback( |
| 510 const IOSChromeBrowsingDataRemover::Callback& callback) { | 510 const IOSChromeBrowsingDataRemover::Callback& callback) { |
| 511 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); | 511 return GetOnBrowsingDataRemovedCallbacks()->Add(callback); |
| 512 } | 512 } |
| OLD | NEW |