summaryrefslogtreecommitdiffstats
path: root/ios/chrome/browser/install_time_util.h
blob: 37285cfd83f33db6ae357d24f97d90efcf0c84ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright 2013 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 IOS_CHROME_BROWSER_INSTALL_TIME_UTIL_H_
#define IOS_CHROME_BROWSER_INSTALL_TIME_UTIL_H_

#include "base/time/time.h"

namespace install_time_util {

extern const int64 kUnknownInstallDate;

// Computes the true installation time of the application based on the current
// install time stored in NSUserDefaults and whether or not this is a first run
// launch.  This function will return a base::Time corresponding to
// |kUnknownInstallDate| if the true installation time is unknown.
base::Time ComputeInstallationTime(bool is_first_run);

// Internal implementation of |ComputeInstallationTime()|.  Exposed only for
// testing.
base::Time ComputeInstallationTimeInternal(
    bool is_first_run,
    base::Time ns_user_defaults_install_time);

}  // namespace install_time_util

#endif  // IOS_CHROME_BROWSER_INSTALL_TIME_UTIL_H_