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> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "chrome/browser/first_run/first_run_internal.h" | |
14 | 15 |
15 class GURL; | 16 class GURL; |
16 class Profile; | 17 class Profile; |
17 | 18 |
18 namespace base { | 19 namespace base { |
19 class CommandLine; | 20 class CommandLine; |
20 class FilePath; | 21 class FilePath; |
21 } | 22 } |
22 | 23 |
23 namespace user_prefs { | 24 namespace user_prefs { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 bool welcome_page_on_os_upgrade_enabled; | 81 bool welcome_page_on_os_upgrade_enabled; |
81 std::vector<GURL> new_tabs; | 82 std::vector<GURL> new_tabs; |
82 std::vector<GURL> bookmarks; | 83 std::vector<GURL> bookmarks; |
83 std::string import_bookmarks_path; | 84 std::string import_bookmarks_path; |
84 std::string compressed_variations_seed; | 85 std::string compressed_variations_seed; |
85 std::string variations_seed; | 86 std::string variations_seed; |
86 std::string variations_seed_signature; | 87 std::string variations_seed_signature; |
87 std::string suppress_default_browser_prompt_for_version; | 88 std::string suppress_default_browser_prompt_for_version; |
88 }; | 89 }; |
89 | 90 |
90 // Returns true if this is the first time chrome is run for this user. | 91 // Returns true if Chrome should behave as if this is the first time Chrome is |
92 // run for this user. | |
91 bool IsChromeFirstRun(); | 93 bool IsChromeFirstRun(); |
92 | 94 |
95 // Helper for IsChromeFirstRun. Exposed for testing. | |
96 internal::FirstRunState DetermineFirstRunState(bool has_sentinel, | |
grt (UTC plus 2)
2016/09/09 11:40:29
can you move this into first_run_internal.h and pu
| |
97 bool has_force_switch, | |
98 bool has_suppress_switch); | |
99 | |
93 #if defined(OS_MACOSX) | 100 #if defined(OS_MACOSX) |
94 // Returns true if |command_line|'s switches explicitly specify that first run | 101 // Returns true if |command_line|'s switches explicitly specify that first run |
95 // should be suppressed in the current run. | 102 // should be suppressed in the current run. |
96 bool IsFirstRunSuppressed(const base::CommandLine& command_line); | 103 bool IsFirstRunSuppressed(const base::CommandLine& command_line); |
97 #endif | 104 #endif |
98 | 105 |
99 // Returns whether metrics reporting is currently opt-in. This is used to | 106 // 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 | 107 // 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 | 108 // 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, | 109 // 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 | 135 // exactly once, so that the browser loads the welcome tab once the |
129 // message loop gets going. | 136 // message loop gets going. |
130 void SetShouldShowWelcomePage(); | 137 void SetShouldShowWelcomePage(); |
131 | 138 |
132 // Returns true if the welcome page should be shown. | 139 // Returns true if the welcome page should be shown. |
133 // | 140 // |
134 // This will return true only once: The first time it is called after | 141 // This will return true only once: The first time it is called after |
135 // SetShouldShowWelcomePage() is called. | 142 // SetShouldShowWelcomePage() is called. |
136 bool ShouldShowWelcomePage(); | 143 bool ShouldShowWelcomePage(); |
137 | 144 |
145 // Iterates over the given tabs, replacing "magic words" designated for | |
146 // use in Master Preferences files with corresponding URLs. | |
147 std::vector<GURL> ProcessMasterPrefsTabs(const std::vector<GURL>& tabs); | |
148 | |
138 // Sets a flag that will cause ShouldDoPersonalDataManagerFirstRun() | 149 // Sets a flag that will cause ShouldDoPersonalDataManagerFirstRun() |
139 // to return true exactly once, so that the browser loads | 150 // to return true exactly once, so that the browser loads |
140 // PersonalDataManager once the main message loop gets going. | 151 // PersonalDataManager once the main message loop gets going. |
141 void SetShouldDoPersonalDataManagerFirstRun(); | 152 void SetShouldDoPersonalDataManagerFirstRun(); |
142 | 153 |
143 // Returns true if the autofill personal data manager first-run action | 154 // Returns true if the autofill personal data manager first-run action |
144 // should be taken. | 155 // should be taken. |
145 // | 156 // |
146 // This will return true only once, the first time it is called after | 157 // This will return true only once, the first time it is called after |
147 // SetShouldDoPersonalDataManagerFirstRun() is called. | 158 // SetShouldDoPersonalDataManagerFirstRun() is called. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
185 // | 196 // |
186 // See chrome/installer/util/master_preferences.h for a description of | 197 // See chrome/installer/util/master_preferences.h for a description of |
187 // 'master_preferences' file. | 198 // 'master_preferences' file. |
188 ProcessMasterPreferencesResult ProcessMasterPreferences( | 199 ProcessMasterPreferencesResult ProcessMasterPreferences( |
189 const base::FilePath& user_data_dir, | 200 const base::FilePath& user_data_dir, |
190 MasterPrefs* out_prefs); | 201 MasterPrefs* out_prefs); |
191 | 202 |
192 } // namespace first_run | 203 } // namespace first_run |
193 | 204 |
194 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 205 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
OLD | NEW |