| 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_H_ | 5 #ifndef CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 6 #define CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 std::string import_bookmarks_path; | 83 std::string import_bookmarks_path; |
| 84 std::string compressed_variations_seed; | 84 std::string compressed_variations_seed; |
| 85 std::string variations_seed; | 85 std::string variations_seed; |
| 86 std::string variations_seed_signature; | 86 std::string variations_seed_signature; |
| 87 std::string suppress_default_browser_prompt_for_version; | 87 std::string suppress_default_browser_prompt_for_version; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 // Returns true if this is the first time chrome is run for this user. | 90 // Returns true if this is the first time chrome is run for this user. |
| 91 bool IsChromeFirstRun(); | 91 bool IsChromeFirstRun(); |
| 92 | 92 |
| 93 // Testing-only function used to confirm behaviors specific to first run (or |
| 94 // non-first run). |
| 95 void SetFirstRunForTesting(bool is_first_run); |
| 96 |
| 93 #if defined(OS_MACOSX) | 97 #if defined(OS_MACOSX) |
| 94 // Returns true if |command_line|'s switches explicitly specify that first run | 98 // Returns true if |command_line|'s switches explicitly specify that first run |
| 95 // should be suppressed in the current run. | 99 // should be suppressed in the current run. |
| 96 bool IsFirstRunSuppressed(const base::CommandLine& command_line); | 100 bool IsFirstRunSuppressed(const base::CommandLine& command_line); |
| 97 #endif | 101 #endif |
| 98 | 102 |
| 99 // Returns whether metrics reporting is currently opt-in. This is used to | 103 // Returns whether metrics reporting is currently opt-in. This is used to |
| 100 // determine if the enable metrics reporting checkbox on first-run should be | 104 // determine if the enable metrics reporting checkbox on first-run should be |
| 101 // initially checked. Opt-in means it is not initially checked, opt-out means it | 105 // initially checked. Opt-in means it is not initially checked, opt-out means it |
| 102 // is. This is not guaranteed to be correct outside of the first-run situation, | 106 // is. This is not guaranteed to be correct outside of the first-run situation, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 128 // exactly once, so that the browser loads the welcome tab once the | 132 // exactly once, so that the browser loads the welcome tab once the |
| 129 // message loop gets going. | 133 // message loop gets going. |
| 130 void SetShouldShowWelcomePage(); | 134 void SetShouldShowWelcomePage(); |
| 131 | 135 |
| 132 // Returns true if the welcome page should be shown. | 136 // Returns true if the welcome page should be shown. |
| 133 // | 137 // |
| 134 // This will return true only once: The first time it is called after | 138 // This will return true only once: The first time it is called after |
| 135 // SetShouldShowWelcomePage() is called. | 139 // SetShouldShowWelcomePage() is called. |
| 136 bool ShouldShowWelcomePage(); | 140 bool ShouldShowWelcomePage(); |
| 137 | 141 |
| 142 // Gets the URL for the "Welcome to Chrome" dialog. |
| 143 // TODO(tmartino): Update to return new Welcome page when complete, |
| 144 // subject to check against kUseConsolidatedFirstRun feature. |
| 145 GURL GetWelcomePageURL(); |
| 146 |
| 147 // Returns true iff the current OS is Windows and the version is >= 10. |
| 148 // TODO(tmartino): Move to first_run_internal_win once Win10 logic is |
| 149 // implemented. |
| 150 bool IsWin10(); |
| 151 |
| 152 // Checks internal state regarding first-run and onboarding, and returns |
| 153 // a vector, possibly empty, of tabs to be shown to the user. |
| 154 std::vector<GURL> GetOnboardingTabs(); |
| 155 |
| 156 // Iterates over the given tabs, replacing "magic words" designated for |
| 157 // use in Master Prefs files with corresponding URLs. |
| 158 std::vector<GURL> ProcessMasterPrefsTabs(const std::vector<GURL>& tabs); |
| 159 |
| 138 // Sets a flag that will cause ShouldDoPersonalDataManagerFirstRun() | 160 // Sets a flag that will cause ShouldDoPersonalDataManagerFirstRun() |
| 139 // to return true exactly once, so that the browser loads | 161 // to return true exactly once, so that the browser loads |
| 140 // PersonalDataManager once the main message loop gets going. | 162 // PersonalDataManager once the main message loop gets going. |
| 141 void SetShouldDoPersonalDataManagerFirstRun(); | 163 void SetShouldDoPersonalDataManagerFirstRun(); |
| 142 | 164 |
| 143 // Returns true if the autofill personal data manager first-run action | 165 // Returns true if the autofill personal data manager first-run action |
| 144 // should be taken. | 166 // should be taken. |
| 145 // | 167 // |
| 146 // This will return true only once, the first time it is called after | 168 // This will return true only once, the first time it is called after |
| 147 // SetShouldDoPersonalDataManagerFirstRun() is called. | 169 // SetShouldDoPersonalDataManagerFirstRun() is called. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 // | 207 // |
| 186 // See chrome/installer/util/master_preferences.h for a description of | 208 // See chrome/installer/util/master_preferences.h for a description of |
| 187 // 'master_preferences' file. | 209 // 'master_preferences' file. |
| 188 ProcessMasterPreferencesResult ProcessMasterPreferences( | 210 ProcessMasterPreferencesResult ProcessMasterPreferences( |
| 189 const base::FilePath& user_data_dir, | 211 const base::FilePath& user_data_dir, |
| 190 MasterPrefs* out_prefs); | 212 MasterPrefs* out_prefs); |
| 191 | 213 |
| 192 } // namespace first_run | 214 } // namespace first_run |
| 193 | 215 |
| 194 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 216 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| OLD | NEW |