Chromium Code Reviews| Index: components/autofill/core/browser/autofill_clock.h |
| diff --git a/components/autofill/core/browser/autofill_clock.h b/components/autofill/core/browser/autofill_clock.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cacb5e3e95292009eb8d0e3e27561e5f31b6f1da |
| --- /dev/null |
| +++ b/components/autofill/core/browser/autofill_clock.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_ |
| +#define COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_ |
| + |
|
Mathieu
2017/01/25 19:57:24
include <memory>
sebsg
2017/01/25 21:35:27
Done.
|
| +#include "base/gtest_prod_util.h" |
| +#include "base/lazy_instance.h" |
| +#include "base/macros.h" |
| +#include "base/memory/ptr_util.h" |
|
Mathieu
2017/01/25 19:57:24
need?
sebsg
2017/01/25 21:35:27
Not anymore!
|
| + |
| +namespace base { |
| +class Clock; |
| +class Time; |
| +} // namespace base |
| + |
| +namespace autofill { |
| + |
| +class AutofillClock { |
| + public: |
| + static base::Time Now(); |
| + |
| + AutofillClock(); |
| + ~AutofillClock(); |
| + AutofillClock(AutofillClock const&) = delete; |
|
Mathieu
2017/01/25 19:57:24
is that DISALLOW_COPY_AND_ASSIGN?
sebsg
2017/01/25 21:35:27
Done.
|
| + void operator=(AutofillClock const&) = delete; |
| + |
| + private: |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, |
|
Mathieu
2017/01/25 19:57:24
worried this will get cluttered...
friend class
sebsg
2017/01/25 21:35:27
It was much easier that I thought, thanks for the
|
| + AddCreditCard_BasicInformation); |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, |
| + AddProfile_BasicInformation); |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, ApplyProfileUseDatesFix); |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, DontDuplicateServerProfile); |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, MergeProfile_UsageStats); |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, RecordUseOf); |
| + FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, |
| + UpdateServerCreditCardUsageStats); |
| + static void SetClockForTests(base::Clock* clock); |
| + |
| + std::unique_ptr<base::Clock> clock_; |
| +}; |
| + |
| +} // namespace autofill |
| + |
| +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_AUTOFILL_CLOCK_H_ |