[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / first_run / first_run_internal.h
blob70e3de5b3ca3408a36678c139a00f3cfdb88a92a
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_
6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_
8 class MasterPrefs;
9 class Profile;
11 namespace base {
12 class FilePath;
15 namespace installer {
16 class MasterPreferences;
19 namespace first_run {
21 namespace internal {
23 enum FirstRunState {
24 FIRST_RUN_UNKNOWN, // The state is not tested or set yet.
25 FIRST_RUN_TRUE,
26 FIRST_RUN_FALSE,
29 // This variable should only be accessed through IsChromeFirstRun().
30 extern FirstRunState first_run_;
32 // Sets up master preferences by preferences passed by installer.
33 void SetupMasterPrefsFromInstallPrefs(
34 const installer::MasterPreferences& install_prefs,
35 MasterPrefs* out_prefs);
37 // Get the file path of the first run sentinel; returns false on failure.
38 bool GetFirstRunSentinelFilePath(base::FilePath* path);
40 // Create the first run sentinel file; returns false on failure.
41 bool CreateSentinel();
43 // -- Platform-specific functions --
45 void DoPostImportPlatformSpecificTasks(Profile* profile);
47 // Returns true if the sentinel file exists (or the path cannot be obtained).
48 // Migrates Windows legacy sentinel files to the corrent location, if needed.
49 bool IsFirstRunSentinelPresent();
51 // This function has a common implementationin for all non-linux platforms, and
52 // a linux specific implementation.
53 bool IsOrganicFirstRun();
55 // Shows the EULA dialog if required. Returns true if the EULA is accepted,
56 // returns false if the EULA has not been accepted, in which case the browser
57 // should exit.
58 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs);
60 // Returns the path for the master preferences file.
61 base::FilePath MasterPrefsPath();
63 } // namespace internal
64 } // namespace first_run
66 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_