blob: a44a0dec0d2bdc1a616abcd531c3857c61d93240 [file] [log] [blame]
Avi Drissman4a8573c2022-09-09 19:35:541// Copyright 2017 The Chromium Authors
Shuhei Takahashi975f86a42017-08-04 08:54:582// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Yeunjoo Choief8a4a42022-11-08 04:21:055#include "chrome/browser/ash/fileapi/recent_source.h"
Shuhei Takahashi975f86a42017-08-04 08:54:586
Yeunjoo Choi3d9ed38a2022-11-10 02:51:247namespace ash {
Shuhei Takahashi975f86a42017-08-04 08:54:588
Shuhei Takahashif6d87472017-08-22 07:07:049RecentSource::Params::Params(storage::FileSystemContext* file_system_context,
Bo Majewski65e328462024-02-12 06:15:0410 const int32_t call_id,
Shuhei Takahashif6d87472017-08-22 07:07:0411 const GURL& origin,
Bo Majewskid51908972023-10-30 04:40:0112 const std::string& query,
Bo Majewski3fbd24402024-05-16 01:06:1413 size_t max_files,
Shuhei Takahashif6d87472017-08-22 07:07:0414 const base::Time& cutoff_time,
Bo Majewski27fde472023-09-06 05:16:5515 const base::TimeTicks& end_time,
Bo Majewskib5b18802023-11-22 06:04:5316 FileType file_type)
Shuhei Takahashif6d87472017-08-22 07:07:0417 : file_system_context_(file_system_context),
Bo Majewski65e328462024-02-12 06:15:0418 call_id_(call_id),
Shuhei Takahashif6d87472017-08-22 07:07:0419 origin_(origin),
Bo Majewskid51908972023-10-30 04:40:0120 query_(query),
Bo Majewski3fbd24402024-05-16 01:06:1421 max_files_(max_files),
Shuhei Takahashif6d87472017-08-22 07:07:0422 cutoff_time_(cutoff_time),
Naoki Fukinode994842020-01-09 04:01:4123 file_type_(file_type),
Bo Majewskib5b18802023-11-22 06:04:5324 end_time_(end_time) {}
25
Munira Tursunovab67fa752024-11-01 08:49:5826RecentSource::Params::Params(const Params& params)
27 : file_system_context_(params.file_system_context_),
28 call_id_(params.call_id_),
29 origin_(params.origin_),
30 query_(params.query_),
31 max_files_(params.max_files_),
32 cutoff_time_(params.cutoff_time_),
33 file_type_(params.file_type_),
34 end_time_(params.end_time_) {}
Shuhei Takahashif6d87472017-08-22 07:07:0435
Bo Majewski27fde472023-09-06 05:16:5536bool RecentSource::Params::IsLate() const {
37 return base::TimeTicks::Now() > end_time_;
38}
39
Shuhei Takahashif6d87472017-08-22 07:07:0440RecentSource::Params::~Params() = default;
41
Bo Majewski6f33bc82024-05-28 02:24:0042RecentSource::RecentSource(
43 extensions::api::file_manager_private::VolumeType volume_type)
44 : volume_type_(volume_type) {}
Shuhei Takahashi975f86a42017-08-04 08:54:5845
46RecentSource::~RecentSource() = default;
47
Yeunjoo Choi3d9ed38a2022-11-10 02:51:2448} // namespace ash