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 | 14 |
15 class GURL; | 15 class GURL; |
16 class Profile; | 16 class Profile; |
17 | 17 |
18 namespace base { | 18 namespace base { |
19 class CommandLine; | 19 class CommandLine; |
20 class FilePath; | 20 class FilePath; |
21 } | 21 } |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 class WebContents; | 24 class WebContents; |
25 } | 25 } |
26 | 26 |
27 namespace user_prefs { | |
28 class PrefRegistrySyncable; | |
29 } | |
30 | |
31 // This namespace contains the chrome first-run installation actions needed to | 27 // This namespace contains the chrome first-run installation actions needed to |
32 // fully test the custom installer. It also contains the opposite actions to | 28 // fully test the custom installer. It also contains the opposite actions to |
33 // execute during uninstall. When the first run UI is ready we won't | 29 // execute during uninstall. When the first run UI is ready we won't |
34 // do the actions unconditionally. Currently the only action is to create a | 30 // do the actions unconditionally. Currently the only action is to create a |
35 // desktop shortcut. | 31 // desktop shortcut. |
36 // | 32 // |
37 // The way we detect first-run is by looking at a 'sentinel' file. | 33 // The way we detect first-run is by looking at a 'sentinel' file. |
38 // If it does not exist we understand that we need to do the first time | 34 // If it does not exist we understand that we need to do the first time |
39 // install work for this user. After that the sentinel file is created. | 35 // install work for this user. After that the sentinel file is created. |
40 namespace first_run { | 36 namespace first_run { |
(...skipping 27 matching lines...) Expand all Loading... |
68 | 64 |
69 // See ProcessMasterPreferences for more info about this structure. | 65 // See ProcessMasterPreferences for more info about this structure. |
70 struct MasterPrefs { | 66 struct MasterPrefs { |
71 MasterPrefs(); | 67 MasterPrefs(); |
72 ~MasterPrefs(); | 68 ~MasterPrefs(); |
73 | 69 |
74 // TODO(macourteau): as part of the master preferences refactoring effort, | 70 // TODO(macourteau): as part of the master preferences refactoring effort, |
75 // remove items from here which are being stored temporarily only to be later | 71 // remove items from here which are being stored temporarily only to be later |
76 // dumped into local_state. Also see related TODO in chrome_browser_main.cc. | 72 // dumped into local_state. Also see related TODO in chrome_browser_main.cc. |
77 | 73 |
78 int ping_delay; | |
79 bool homepage_defined; | 74 bool homepage_defined; |
80 int do_import_items; | 75 int do_import_items; |
81 int dont_import_items; | 76 int dont_import_items; |
82 bool make_chrome_default_for_user; | 77 bool make_chrome_default_for_user; |
83 bool suppress_first_run_default_browser_prompt; | 78 bool suppress_first_run_default_browser_prompt; |
84 bool welcome_page_on_os_upgrade_enabled; | 79 bool welcome_page_on_os_upgrade_enabled; |
85 std::vector<GURL> new_tabs; | 80 std::vector<GURL> new_tabs; |
86 std::vector<GURL> bookmarks; | 81 std::vector<GURL> bookmarks; |
87 std::string import_bookmarks_path; | 82 std::string import_bookmarks_path; |
88 std::string compressed_variations_seed; | 83 std::string compressed_variations_seed; |
(...skipping 20 matching lines...) Expand all Loading... |
109 // GetMetricsReportingDefaultState in | 104 // GetMetricsReportingDefaultState in |
110 // chrome/browser/metrics/metrics_reporting_state.h, which gives a value that | 105 // chrome/browser/metrics/metrics_reporting_state.h, which gives a value that |
111 // was stored during first-run. | 106 // was stored during first-run. |
112 bool IsMetricsReportingOptIn(); | 107 bool IsMetricsReportingOptIn(); |
113 | 108 |
114 // Creates the first run sentinel if needed. This should only be called after | 109 // Creates the first run sentinel if needed. This should only be called after |
115 // the process singleton has been grabbed by the current process | 110 // the process singleton has been grabbed by the current process |
116 // (http://crbug.com/264694). | 111 // (http://crbug.com/264694). |
117 void CreateSentinelIfNeeded(); | 112 void CreateSentinelIfNeeded(); |
118 | 113 |
119 // Get RLZ ping delay pref name. | |
120 std::string GetPingDelayPrefName(); | |
121 | |
122 // Register user preferences used by the MasterPrefs structure. | |
123 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | |
124 | |
125 // Sets the kShowFirstRunBubbleOption local state pref so that the browser | 114 // Sets the kShowFirstRunBubbleOption local state pref so that the browser |
126 // shows the bubble once the main message loop gets going (or refrains from | 115 // shows the bubble once the main message loop gets going (or refrains from |
127 // showing the bubble, if |show_bubble| is not FIRST_RUN_BUBBLE_SHOW). | 116 // showing the bubble, if |show_bubble| is not FIRST_RUN_BUBBLE_SHOW). |
128 // Once FIRST_RUN_BUBBLE_SUPPRESS is set, no other value can be set. | 117 // Once FIRST_RUN_BUBBLE_SUPPRESS is set, no other value can be set. |
129 // Returns false if the pref service could not be retrieved. | 118 // Returns false if the pref service could not be retrieved. |
130 bool SetShowFirstRunBubblePref(FirstRunBubbleOptions show_bubble_option); | 119 bool SetShowFirstRunBubblePref(FirstRunBubbleOptions show_bubble_option); |
131 | 120 |
132 // Sets a flag that will cause ShouldShowWelcomePage to return true | 121 // Sets a flag that will cause ShouldShowWelcomePage to return true |
133 // exactly once, so that the browser loads the welcome tab once the | 122 // exactly once, so that the browser loads the welcome tab once the |
134 // message loop gets going. | 123 // message loop gets going. |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 // | 186 // |
198 // See chrome/installer/util/master_preferences.h for a description of | 187 // See chrome/installer/util/master_preferences.h for a description of |
199 // 'master_preferences' file. | 188 // 'master_preferences' file. |
200 ProcessMasterPreferencesResult ProcessMasterPreferences( | 189 ProcessMasterPreferencesResult ProcessMasterPreferences( |
201 const base::FilePath& user_data_dir, | 190 const base::FilePath& user_data_dir, |
202 MasterPrefs* out_prefs); | 191 MasterPrefs* out_prefs); |
203 | 192 |
204 } // namespace first_run | 193 } // namespace first_run |
205 | 194 |
206 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 195 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
OLD | NEW |