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/downloads/downloads_api.h" | 5 #include "chrome/browser/extensions/api/downloads/downloads_api.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1517 return true; | 1517 return true; |
1518 } | 1518 } |
1519 | 1519 |
1520 void DownloadsGetFileIconFunction::OnIconURLExtracted(const std::string& url) { | 1520 void DownloadsGetFileIconFunction::OnIconURLExtracted(const std::string& url) { |
1521 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1521 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1522 if (Fault(url.empty(), errors::kIconNotFound, &error_)) { | 1522 if (Fault(url.empty(), errors::kIconNotFound, &error_)) { |
1523 SendResponse(false); | 1523 SendResponse(false); |
1524 return; | 1524 return; |
1525 } | 1525 } |
1526 RecordApiFunctions(DOWNLOADS_FUNCTION_GET_FILE_ICON); | 1526 RecordApiFunctions(DOWNLOADS_FUNCTION_GET_FILE_ICON); |
1527 SetResult(base::MakeUnique<base::StringValue>(url)); | 1527 SetResult(base::MakeUnique<base::Value>(url)); |
1528 SendResponse(true); | 1528 SendResponse(true); |
1529 } | 1529 } |
1530 | 1530 |
1531 ExtensionDownloadsEventRouter::ExtensionDownloadsEventRouter( | 1531 ExtensionDownloadsEventRouter::ExtensionDownloadsEventRouter( |
1532 Profile* profile, | 1532 Profile* profile, |
1533 DownloadManager* manager) | 1533 DownloadManager* manager) |
1534 : profile_(profile), | 1534 : profile_(profile), |
1535 notifier_(manager, this), | 1535 notifier_(manager, this), |
1536 extension_registry_observer_(this) { | 1536 extension_registry_observer_(this) { |
1537 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1537 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 return; | 1920 return; |
1921 base::Time now(base::Time::Now()); | 1921 base::Time now(base::Time::Now()); |
1922 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); | 1922 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); |
1923 if (delta <= kFileExistenceRateLimitSeconds) | 1923 if (delta <= kFileExistenceRateLimitSeconds) |
1924 return; | 1924 return; |
1925 last_checked_removal_ = now; | 1925 last_checked_removal_ = now; |
1926 manager->CheckForHistoryFilesRemoval(); | 1926 manager->CheckForHistoryFilesRemoval(); |
1927 } | 1927 } |
1928 | 1928 |
1929 } // namespace extensions | 1929 } // namespace extensions |
OLD | NEW |