Chromium Code Reviews| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 bool welcome_page_on_os_upgrade_enabled; | 80 bool welcome_page_on_os_upgrade_enabled; |
| 81 std::vector<GURL> new_tabs; | 81 std::vector<GURL> new_tabs; |
| 82 std::vector<GURL> bookmarks; | 82 std::vector<GURL> bookmarks; |
| 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 // Struct which accumulates various properties of the current system for | |
| 91 // determining which, if any, onboarding actions should occur. | |
| 92 struct FirstRunSystemStatus { | |
| 93 // Describes which 'class' of Operating System is running. Any OS's which | |
| 94 // have the same onboarding behavior are considered the same class. | |
| 95 enum OperatingSystemClass { STANDARD = 0, WINDOWS_10 }; | |
| 96 | |
| 97 OperatingSystemClass os_class; | |
| 98 bool is_sentinel_present; | |
| 99 bool is_force_flag_on; | |
| 100 bool is_suppress_flag_on; | |
| 101 }; | |
| 102 | |
| 103 // Gathers properties of current system which are relevant for determining | |
| 104 // onboarding policy. | |
| 105 FirstRunSystemStatus GetFirstRunSystemStatus(); | |
| 106 | |
| 107 // Makes policy decisions based on the given system status, and returns | |
|
grt (UTC plus 2)
2016/08/23 10:36:02
nit: "Returns the (possibly empty) collection of f
| |
| 108 // a vector, possibly empty, of first-run-related tabs to be shown to the user. | |
| 109 std::vector<GURL> GetOnboardingTabs(FirstRunSystemStatus status); | |
| 110 | |
| 90 // Returns true if this is the first time chrome is run for this user. | 111 // Returns true if this is the first time chrome is run for this user. |
| 91 bool IsChromeFirstRun(); | 112 bool IsChromeFirstRun(); |
| 92 | 113 |
| 93 #if defined(OS_MACOSX) | 114 #if defined(OS_MACOSX) |
| 94 // Returns true if |command_line|'s switches explicitly specify that first run | 115 // Returns true if |command_line|'s switches explicitly specify that first run |
| 95 // should be suppressed in the current run. | 116 // should be suppressed in the current run. |
| 96 bool IsFirstRunSuppressed(const base::CommandLine& command_line); | 117 bool IsFirstRunSuppressed(const base::CommandLine& command_line); |
| 97 #endif | 118 #endif |
| 98 | 119 |
| 99 // Returns whether metrics reporting is currently opt-in. This is used to | 120 // Returns whether metrics reporting is currently opt-in. This is used to |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 128 // exactly once, so that the browser loads the welcome tab once the | 149 // exactly once, so that the browser loads the welcome tab once the |
| 129 // message loop gets going. | 150 // message loop gets going. |
| 130 void SetShouldShowWelcomePage(); | 151 void SetShouldShowWelcomePage(); |
| 131 | 152 |
| 132 // Returns true if the welcome page should be shown. | 153 // Returns true if the welcome page should be shown. |
| 133 // | 154 // |
| 134 // This will return true only once: The first time it is called after | 155 // This will return true only once: The first time it is called after |
| 135 // SetShouldShowWelcomePage() is called. | 156 // SetShouldShowWelcomePage() is called. |
| 136 bool ShouldShowWelcomePage(); | 157 bool ShouldShowWelcomePage(); |
| 137 | 158 |
| 159 // Gets the URL for the "Welcome to Chrome" dialog. | |
| 160 // TODO(tmartino): Update to return new Welcome page when complete, | |
| 161 // subject to check against kUseConsolidatedFirstRun feature. | |
| 162 GURL GetWelcomePageURL(); | |
|
grt (UTC plus 2)
2016/08/23 10:36:02
URL -> Url (http://google.github.io/styleguide/cpp
tmartino
2016/09/08 21:33:16
Done (here and throughout)
| |
| 163 | |
| 164 // Iterates over the given tabs, replacing "magic words" designated for | |
| 165 // use in Master Prefs files with corresponding URLs. | |
|
grt (UTC plus 2)
2016/08/23 10:36:02
"Master Prefs" -> "master preferences"
tmartino
2016/09/08 21:33:16
Done
| |
| 166 std::vector<GURL> ProcessMasterPrefsTabs(const std::vector<GURL>& tabs); | |
| 167 | |
| 138 // Sets a flag that will cause ShouldDoPersonalDataManagerFirstRun() | 168 // Sets a flag that will cause ShouldDoPersonalDataManagerFirstRun() |
| 139 // to return true exactly once, so that the browser loads | 169 // to return true exactly once, so that the browser loads |
| 140 // PersonalDataManager once the main message loop gets going. | 170 // PersonalDataManager once the main message loop gets going. |
| 141 void SetShouldDoPersonalDataManagerFirstRun(); | 171 void SetShouldDoPersonalDataManagerFirstRun(); |
| 142 | 172 |
| 143 // Returns true if the autofill personal data manager first-run action | 173 // Returns true if the autofill personal data manager first-run action |
| 144 // should be taken. | 174 // should be taken. |
| 145 // | 175 // |
| 146 // This will return true only once, the first time it is called after | 176 // This will return true only once, the first time it is called after |
| 147 // SetShouldDoPersonalDataManagerFirstRun() is called. | 177 // SetShouldDoPersonalDataManagerFirstRun() is called. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 // | 215 // |
| 186 // See chrome/installer/util/master_preferences.h for a description of | 216 // See chrome/installer/util/master_preferences.h for a description of |
| 187 // 'master_preferences' file. | 217 // 'master_preferences' file. |
| 188 ProcessMasterPreferencesResult ProcessMasterPreferences( | 218 ProcessMasterPreferencesResult ProcessMasterPreferences( |
| 189 const base::FilePath& user_data_dir, | 219 const base::FilePath& user_data_dir, |
| 190 MasterPrefs* out_prefs); | 220 MasterPrefs* out_prefs); |
| 191 | 221 |
| 192 } // namespace first_run | 222 } // namespace first_run |
| 193 | 223 |
| 194 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 224 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| OLD | NEW |