Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: chrome/browser/first_run/first_run.h

Issue 9016036: Implement the new first run bubble, clean up old bubbles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and merge, fix SetShowFirstRunBubblePref and test, update copyright years. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // sentinel file could not be removed. 48 // sentinel file could not be removed.
49 bool RemoveSentinel(); 49 bool RemoveSentinel();
50 50
51 // Sets the kShouldShowFirstRunBubble local state pref so that the browser 51 // Sets the kShouldShowFirstRunBubble local state pref so that the browser
52 // shows the bubble once the main message loop gets going (or refrains from 52 // shows the bubble once the main message loop gets going (or refrains from
53 // showing the bubble, if |show_bubble| is false). Returns false if the pref 53 // showing the bubble, if |show_bubble| is false). Returns false if the pref
54 // could not be set. This function can be called multiple times, but only the 54 // could not be set. This function can be called multiple times, but only the
55 // initial call will actually set the preference. 55 // initial call will actually set the preference.
56 bool SetShowFirstRunBubblePref(bool show_bubble); 56 bool SetShowFirstRunBubblePref(bool show_bubble);
57 57
58 // Sets the kShouldUseMinimalFirstRunBubble local state pref so that the
59 // browser shows the minimal first run bubble once the main message loop
60 // gets going. Returns false if the pref could not be set.
61 bool SetMinimalFirstRunBubblePref();
62
63 // Sets the kShouldShowWelcomePage local state pref so that the browser 58 // Sets the kShouldShowWelcomePage local state pref so that the browser
64 // loads the welcome tab once the message loop gets going. Returns false 59 // loads the welcome tab once the message loop gets going. Returns false
65 // if the pref could not be set. 60 // if the pref could not be set.
66 bool SetShowWelcomePagePref(); 61 bool SetShowWelcomePagePref();
67 62
68 // Sets the kAutofillPersonalDataManagerFirstRun local state pref so that the 63 // Sets the kAutofillPersonalDataManagerFirstRun local state pref so that the
69 // browser loads PersonalDataManager once the main message loop gets going. 64 // browser loads PersonalDataManager once the main message loop gets going.
70 // Returns false if the pref could not be set. 65 // Returns false if the pref could not be set.
71 bool SetPersonalDataManagerFirstRunPref(); 66 bool SetPersonalDataManagerFirstRunPref();
72 67
(...skipping 22 matching lines...) Expand all
95 // fully test the custom installer. It also contains the opposite actions to 90 // fully test the custom installer. It also contains the opposite actions to
96 // execute during uninstall. When the first run UI is ready we won't 91 // execute during uninstall. When the first run UI is ready we won't
97 // do the actions unconditionally. Currently the only action is to create a 92 // do the actions unconditionally. Currently the only action is to create a
98 // desktop shortcut. 93 // desktop shortcut.
99 // 94 //
100 // The way we detect first-run is by looking at a 'sentinel' file. 95 // The way we detect first-run is by looking at a 'sentinel' file.
101 // If it does not exist we understand that we need to do the first time 96 // If it does not exist we understand that we need to do the first time
102 // install work for this user. After that the sentinel file is created. 97 // install work for this user. After that the sentinel file is created.
103 class FirstRun { 98 class FirstRun {
104 public: 99 public:
105 // There are three types of possible first run bubbles:
106 enum BubbleType {
107 LARGE_BUBBLE, // The normal bubble, with search engine choice
108 OEM_BUBBLE, // Smaller bubble for OEM builds
109 MINIMAL_BUBBLE // Minimal bubble shown after search engine dialog
110 };
111
112 // See ProcessMasterPreferences for more info about this structure. 100 // See ProcessMasterPreferences for more info about this structure.
113 struct MasterPrefs { 101 struct MasterPrefs {
114 MasterPrefs(); 102 MasterPrefs();
115 ~MasterPrefs(); 103 ~MasterPrefs();
116 104
117 int ping_delay; 105 int ping_delay;
118 bool homepage_defined; 106 bool homepage_defined;
119 int do_import_items; 107 int do_import_items;
120 int dont_import_items; 108 int dont_import_items;
121 bool run_search_engine_experiment; 109 bool run_search_engine_experiment;
(...skipping 12 matching lines...) Expand all
134 // |preference_details|. 122 // |preference_details|.
135 // 123 //
136 // This function destroys any existing prefs file and it is meant to be 124 // This function destroys any existing prefs file and it is meant to be
137 // invoked only on first run. 125 // invoked only on first run.
138 // 126 //
139 // See chrome/installer/util/master_preferences.h for a description of 127 // See chrome/installer/util/master_preferences.h for a description of
140 // 'master_preferences' file. 128 // 'master_preferences' file.
141 static bool ProcessMasterPreferences(const FilePath& user_data_dir, 129 static bool ProcessMasterPreferences(const FilePath& user_data_dir,
142 MasterPrefs* out_prefs); 130 MasterPrefs* out_prefs);
143 131
144 // Sets the kShouldUseOEMFirstRunBubble local state pref so that the
145 // browser shows the OEM first run bubble once the main message loop
146 // gets going. Returns false if the pref could not be set.
147 static bool SetOEMFirstRunBubblePref();
148
149 // Whether the search engine selection dialog should be shown on first run. 132 // Whether the search engine selection dialog should be shown on first run.
150 static bool ShouldShowSearchEngineSelector(const TemplateURLService* model); 133 static bool ShouldShowSearchEngineSelector(const TemplateURLService* model);
151 134
152 // -- Platform-specific functions -- 135 // -- Platform-specific functions --
153 136
154 // Returns the path for the master preferences file. 137 // Returns the path for the master preferences file.
155 static FilePath MasterPrefsPath(); 138 static FilePath MasterPrefsPath();
156 139
157 private: 140 private:
158 friend class FirstRunTest; 141 friend class FirstRunTest;
(...skipping 17 matching lines...) Expand all
176 // is running. 159 // is running.
177 static void DoDelayedInstallExtensions(); 160 static void DoDelayedInstallExtensions();
178 161
179 #endif 162 #endif
180 163
181 // This class is for scoping purposes. 164 // This class is for scoping purposes.
182 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); 165 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun);
183 }; 166 };
184 167
185 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ 168 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698