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 <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 if (include_incognito() && GetProfile()->HasOffTheRecordProfile()) | 956 if (include_incognito() && GetProfile()->HasOffTheRecordProfile()) |
957 current_profile = GetProfile()->GetOffTheRecordProfile(); | 957 current_profile = GetProfile()->GetOffTheRecordProfile(); |
958 | 958 |
959 content::StoragePartition* storage_partition = | 959 content::StoragePartition* storage_partition = |
960 BrowserContext::GetStoragePartition( | 960 BrowserContext::GetStoragePartition( |
961 render_frame_host()->GetProcess()->GetBrowserContext(), | 961 render_frame_host()->GetProcess()->GetBrowserContext(), |
962 render_frame_host()->GetSiteInstance()); | 962 render_frame_host()->GetSiteInstance()); |
963 std::unique_ptr<content::DownloadUrlParameters> download_params( | 963 std::unique_ptr<content::DownloadUrlParameters> download_params( |
964 new content::DownloadUrlParameters( | 964 new content::DownloadUrlParameters( |
965 download_url, render_frame_host()->GetProcess()->GetID(), | 965 download_url, render_frame_host()->GetProcess()->GetID(), |
966 render_view_host_do_not_use()->GetRoutingID(), | 966 render_frame_host()->GetRenderViewHost()->GetRoutingID(), |
967 render_frame_host()->GetRoutingID(), | 967 render_frame_host()->GetRoutingID(), |
968 storage_partition->GetURLRequestContext())); | 968 storage_partition->GetURLRequestContext())); |
969 | 969 |
970 base::FilePath creator_suggested_filename; | 970 base::FilePath creator_suggested_filename; |
971 if (options.filename.get()) { | 971 if (options.filename.get()) { |
972 #if defined(OS_WIN) | 972 #if defined(OS_WIN) |
973 // Can't get filename16 from options.ToValue() because that converts it from | 973 // Can't get filename16 from options.ToValue() because that converts it from |
974 // std::string. | 974 // std::string. |
975 base::DictionaryValue* options_value = NULL; | 975 base::DictionaryValue* options_value = NULL; |
976 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &options_value)); | 976 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &options_value)); |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1900 return; | 1900 return; |
1901 base::Time now(base::Time::Now()); | 1901 base::Time now(base::Time::Now()); |
1902 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); | 1902 int delta = now.ToTimeT() - last_checked_removal_.ToTimeT(); |
1903 if (delta <= kFileExistenceRateLimitSeconds) | 1903 if (delta <= kFileExistenceRateLimitSeconds) |
1904 return; | 1904 return; |
1905 last_checked_removal_ = now; | 1905 last_checked_removal_ = now; |
1906 manager->CheckForHistoryFilesRemoval(); | 1906 manager->CheckForHistoryFilesRemoval(); |
1907 } | 1907 } |
1908 | 1908 |
1909 } // namespace extensions | 1909 } // namespace extensions |
OLD | NEW |