| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ | 5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ |
| 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ | 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace base { | 24 namespace base { |
| 25 class FilePath; | 25 class FilePath; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace installer { | 28 namespace installer { |
| 29 class MasterPreferences; | 29 class MasterPreferences; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace first_run { | 32 namespace first_run { |
| 33 |
| 33 namespace internal { | 34 namespace internal { |
| 34 | 35 |
| 36 // Flags indicating whether a first-run profile auto import was performed, and |
| 37 // whether the importer process exited successfully. |
| 38 extern bool g_did_perform_profile_import; |
| 39 extern bool g_profile_import_exited_successfully; |
| 40 |
| 35 enum FirstRunState { | 41 enum FirstRunState { |
| 36 FIRST_RUN_UNKNOWN, // The state is not tested or set yet. | 42 FIRST_RUN_UNKNOWN, // The state is not tested or set yet. |
| 37 FIRST_RUN_TRUE, | 43 FIRST_RUN_TRUE, |
| 38 FIRST_RUN_FALSE | 44 FIRST_RUN_FALSE |
| 39 }; | 45 }; |
| 40 | 46 |
| 41 // This variable should only be accessed through IsChromeFirstRun(). | 47 // This variable should only be accessed through IsChromeFirstRun(). |
| 42 extern FirstRunState first_run_; | 48 extern FirstRunState first_run_; |
| 43 | 49 |
| 44 // Loads master preferences from the master preference file into the installer | 50 // Loads master preferences from the master preference file into the installer |
| (...skipping 12 matching lines...) Expand all Loading... |
| 57 const installer::MasterPreferences& install_prefs, | 63 const installer::MasterPreferences& install_prefs, |
| 58 MasterPrefs* out_prefs); | 64 MasterPrefs* out_prefs); |
| 59 | 65 |
| 60 void SetDefaultBrowser(installer::MasterPreferences* install_prefs); | 66 void SetDefaultBrowser(installer::MasterPreferences* install_prefs); |
| 61 | 67 |
| 62 // Returns true if first run ui should be skipped, which is the case that | 68 // Returns true if first run ui should be skipped, which is the case that |
| 63 // skip_first_run_ui setting is set to true. In the case the setting is | 69 // skip_first_run_ui setting is set to true. In the case the setting is |
| 64 // not found or specified, it returns false by default. | 70 // not found or specified, it returns false by default. |
| 65 bool SkipFirstRunUI(installer::MasterPreferences* install_prefs); | 71 bool SkipFirstRunUI(installer::MasterPreferences* install_prefs); |
| 66 | 72 |
| 67 // Sets ping_delay. | 73 // Imports settings. This may be done in a separate process depending on the |
| 68 void SetRLZPref(first_run::MasterPrefs* out_prefs, | 74 // platform, but it will always block until done. The return value indicates |
| 69 installer::MasterPreferences* install_prefs); | 75 // success. |
| 76 // This functions has a common implementation for OS_POSIX, and a |
| 77 // windows specific implementation. |
| 78 bool ImportSettings(Profile* profile, |
| 79 scoped_refptr<ImporterHost> importer_host, |
| 80 scoped_refptr<ImporterList> importer_list, |
| 81 int items_to_import); |
| 70 | 82 |
| 71 // -- Platform-specific functions -- | 83 // -- Platform-specific functions -- |
| 72 | 84 |
| 73 void DoPostImportPlatformSpecificTasks(); | 85 void DoPostImportPlatformSpecificTasks(); |
| 74 | 86 |
| 75 // Gives the full path to the sentinel file. The file might not exist. | 87 // Gives the full path to the sentinel file. The file might not exist. |
| 76 // This function has a common implementation on OS_POSIX and a windows specific | 88 // This function has a common implementation on OS_POSIX and a windows specific |
| 77 // implementation. | 89 // implementation. |
| 78 bool GetFirstRunSentinelFilePath(base::FilePath* path); | 90 bool GetFirstRunSentinelFilePath(base::FilePath* path); |
| 79 | 91 |
| 80 // This function has a common implementationin for all non-linux platforms, and | 92 // This function has a common implementationin for all non-linux platforms, and |
| 81 // a linux specific implementation. | 93 // a linux specific implementation. |
| 82 bool IsOrganicFirstRun(); | 94 bool IsOrganicFirstRun(); |
| 83 | 95 |
| 84 // Imports settings. This may be done in a separate process depending on the | |
| 85 // platform, but it will always block until done. The return value indicates | |
| 86 // success. | |
| 87 // This functions has a common implementation for OS_POSIX, and a | |
| 88 // windows specific implementation. | |
| 89 bool ImportSettings(Profile* profile, | |
| 90 scoped_refptr<ImporterHost> importer_host, | |
| 91 scoped_refptr<ImporterList> importer_list, | |
| 92 int items_to_import); | |
| 93 | |
| 94 // Sets import preferences and launch the import process. | 96 // Sets import preferences and launch the import process. |
| 95 void SetImportPreferencesAndLaunchImport( | 97 void SetImportPreferencesAndLaunchImport(MasterPrefs* out_prefs); |
| 96 MasterPrefs* out_prefs, | |
| 97 installer::MasterPreferences* install_prefs); | |
| 98 | 98 |
| 99 int ImportBookmarkFromFileIfNeeded(Profile* profile, | 99 int ImportBookmarkFromFileIfNeeded(Profile* profile, |
| 100 const CommandLine& cmdline); | 100 const CommandLine& cmdline); |
| 101 | 101 |
| 102 #if !defined(OS_WIN) | 102 #if !defined(OS_WIN) |
| 103 bool ImportBookmarks(const base::FilePath& import_bookmarks_path); | 103 bool ImportBookmarks(const base::FilePath& import_bookmarks_path); |
| 104 #endif | 104 #endif |
| 105 | 105 |
| 106 // Shows the EULA dialog if required. Returns true if the EULA is accepted, | 106 // Shows the EULA dialog if required. Returns true if the EULA is accepted, |
| 107 // returns false if the EULA has not been accepted, in which case the browser | 107 // returns false if the EULA has not been accepted, in which case the browser |
| 108 // should exit. | 108 // should exit. |
| 109 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs); | 109 bool ShowPostInstallEULAIfNeeded(installer::MasterPreferences* install_prefs); |
| 110 | 110 |
| 111 } // namespace internal | 111 } // namespace internal |
| 112 } // namespace first_run | 112 } // namespace first_run |
| 113 | 113 |
| 114 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ | 114 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_INTERNAL_H_ |
| OLD | NEW |