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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1323 } | 1323 } |
1324 | 1324 |
1325 DownloadsShowDefaultFolderFunction::DownloadsShowDefaultFolderFunction() {} | 1325 DownloadsShowDefaultFolderFunction::DownloadsShowDefaultFolderFunction() {} |
1326 | 1326 |
1327 DownloadsShowDefaultFolderFunction::~DownloadsShowDefaultFolderFunction() {} | 1327 DownloadsShowDefaultFolderFunction::~DownloadsShowDefaultFolderFunction() {} |
1328 | 1328 |
1329 bool DownloadsShowDefaultFolderFunction::RunAsync() { | 1329 bool DownloadsShowDefaultFolderFunction::RunAsync() { |
1330 DownloadManager* manager = NULL; | 1330 DownloadManager* manager = NULL; |
1331 DownloadManager* incognito_manager = NULL; | 1331 DownloadManager* incognito_manager = NULL; |
1332 GetManagers(GetProfile(), include_incognito(), &manager, &incognito_manager); | 1332 GetManagers(GetProfile(), include_incognito(), &manager, &incognito_manager); |
1333 platform_util::OpenItem( | 1333 platform_util::OpenFolder( |
1334 GetProfile(), | 1334 GetProfile(), DownloadPrefs::FromDownloadManager(manager)->DownloadPath(), |
1335 DownloadPrefs::FromDownloadManager(manager)->DownloadPath()); | 1335 platform_util::OpenOperationCallback()); |
1336 RecordApiFunctions(DOWNLOADS_FUNCTION_SHOW_DEFAULT_FOLDER); | 1336 RecordApiFunctions(DOWNLOADS_FUNCTION_SHOW_DEFAULT_FOLDER); |
1337 return true; | 1337 return true; |
1338 } | 1338 } |
1339 | 1339 |
1340 DownloadsOpenFunction::DownloadsOpenFunction() {} | 1340 DownloadsOpenFunction::DownloadsOpenFunction() {} |
1341 | 1341 |
1342 DownloadsOpenFunction::~DownloadsOpenFunction() {} | 1342 DownloadsOpenFunction::~DownloadsOpenFunction() {} |
1343 | 1343 |
1344 bool DownloadsOpenFunction::RunSync() { | 1344 bool DownloadsOpenFunction::RunSync() { |
1345 scoped_ptr<downloads::Open::Params> params( | 1345 scoped_ptr<downloads::Open::Params> params( |
(...skipping 554 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 |