Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / first_run / first_run_internal.h
bloba2fa2612b40dad551a89133a1a2672d6b1155547
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,
27 FIRST_RUN_CANCEL, // This shouldn't be considered first run but the sentinel
28 // should be created anyways.
31 // This variable should only be accessed through IsChromeFirstRun().
32 extern FirstRunState first_run_;
34 // Generates an initial user preference file in |user_data_dir| using the data
35 // in |master_prefs|.
36 bool GeneratePrefFile(const base::FilePath& user_data_dir,
37 const installer::MasterPreferences& master_prefs);
39 // Sets up master preferences by preferences passed by installer.
40 void SetupMasterPrefsFromInstallPrefs(
41 const installer::MasterPreferences& install_prefs,
42 MasterPrefs* out_prefs);
44 // Creates the sentinel file that signals that chrome has been configured.
45 bool CreateSentinel();
47 // -- Platform-specific functions --
49 void DoPostImportPlatformSpecificTasks(Profile* profile);
51 // Gives the full path to the sentinel file. The file might not exist.
52 // This function has a common implementation on OS_POSIX and a windows specific
53 // implementation.
54 bool GetFirstRunSentinelFilePath(base::FilePath* path);
56 // This function has a common implementationin for all non-linux platforms, and
57 // a linux specific implementation.
58 bool IsOrganicFirstRun();
60 // Shows the EULA dialog if required. Returns true if the EULA is accepted,
61 // returns false if the EULA has not been accepted, in which case the browser
62 // should exit.
63 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs);
65 // Returns the path for the master preferences file.
66 base::FilePath MasterPrefsPath();
68 } // namespace internal
69 } // namespace first_run
71 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_