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/extensions/api/history/history_api.h" | 5 #include "chrome/browser/extensions/api/history/history_api.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 bool HistoryDeleteAllFunction::RunAsyncImpl() { | 482 bool HistoryDeleteAllFunction::RunAsyncImpl() { |
483 if (!VerifyDeleteAllowed()) | 483 if (!VerifyDeleteAllowed()) |
484 return false; | 484 return false; |
485 | 485 |
486 std::set<GURL> restrict_urls; | 486 std::set<GURL> restrict_urls; |
487 HistoryService* hs = | 487 HistoryService* hs = |
488 HistoryServiceFactory::GetForProfile(profile(), | 488 HistoryServiceFactory::GetForProfile(profile(), |
489 Profile::EXPLICIT_ACCESS); | 489 Profile::EXPLICIT_ACCESS); |
490 hs->ExpireHistoryBetween( | 490 hs->ExpireHistoryBetween( |
491 restrict_urls, | 491 restrict_urls, |
492 base::Time::UnixEpoch(), // From the beginning of the epoch. | 492 base::Time(), // Unbounded beginning... |
493 base::Time::Now(), // To the current time. | 493 base::Time(), // ...and the end. |
494 base::Bind(&HistoryDeleteAllFunction::DeleteComplete, | 494 base::Bind(&HistoryDeleteAllFunction::DeleteComplete, |
495 base::Unretained(this)), | 495 base::Unretained(this)), |
496 &task_tracker_); | 496 &task_tracker_); |
497 | 497 |
498 return true; | 498 return true; |
499 } | 499 } |
500 | 500 |
501 void HistoryDeleteAllFunction::DeleteComplete() { | 501 void HistoryDeleteAllFunction::DeleteComplete() { |
502 SendAsyncResponse(); | 502 SendAsyncResponse(); |
503 } | 503 } |
504 | 504 |
505 } // namespace extensions | 505 } // namespace extensions |
OLD | NEW |