| 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 #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 Loading... |
| 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 |
| 73 // Sets the kShouldUseOEMFirstRunBubble local state pref so that the | |
| 74 // browser shows the OEM first run bubble once the main message loop | |
| 75 // gets going. Returns false if the pref could not be set. | |
| 76 bool SetOEMFirstRunBubblePref(); | |
| 77 | |
| 78 // Whether the search engine selection dialog should be shown on first run. | 68 // Whether the search engine selection dialog should be shown on first run. |
| 79 bool ShouldShowSearchEngineSelector(const TemplateURLService* model); | 69 bool ShouldShowSearchEngineSelector(const TemplateURLService* model); |
| 80 | 70 |
| 81 // -- Platform-specific functions -- | 71 // -- Platform-specific functions -- |
| 82 | 72 |
| 83 // Automatically import history and home page (and search engine, if | 73 // Automatically import history and home page (and search engine, if |
| 84 // ShouldShowSearchEngineDialog is true). | 74 // ShouldShowSearchEngineDialog is true). |
| 85 void AutoImport(Profile* profile, | 75 void AutoImport(Profile* profile, |
| 86 bool homepage_defined, | 76 bool homepage_defined, |
| 87 int import_items, | 77 int import_items, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 106 // fully test the custom installer. It also contains the opposite actions to | 96 // fully test the custom installer. It also contains the opposite actions to |
| 107 // execute during uninstall. When the first run UI is ready we won't | 97 // execute during uninstall. When the first run UI is ready we won't |
| 108 // do the actions unconditionally. Currently the only action is to create a | 98 // do the actions unconditionally. Currently the only action is to create a |
| 109 // desktop shortcut. | 99 // desktop shortcut. |
| 110 // | 100 // |
| 111 // The way we detect first-run is by looking at a 'sentinel' file. | 101 // The way we detect first-run is by looking at a 'sentinel' file. |
| 112 // If it does not exist we understand that we need to do the first time | 102 // If it does not exist we understand that we need to do the first time |
| 113 // install work for this user. After that the sentinel file is created. | 103 // install work for this user. After that the sentinel file is created. |
| 114 class FirstRun { | 104 class FirstRun { |
| 115 public: | 105 public: |
| 116 // There are three types of possible first run bubbles: | |
| 117 enum BubbleType { | |
| 118 LARGE_BUBBLE, // The normal bubble, with search engine choice | |
| 119 OEM_BUBBLE, // Smaller bubble for OEM builds | |
| 120 MINIMAL_BUBBLE // Minimal bubble shown after search engine dialog | |
| 121 }; | |
| 122 | |
| 123 // See ProcessMasterPreferences for more info about this structure. | 106 // See ProcessMasterPreferences for more info about this structure. |
| 124 struct MasterPrefs { | 107 struct MasterPrefs { |
| 125 MasterPrefs(); | 108 MasterPrefs(); |
| 126 ~MasterPrefs(); | 109 ~MasterPrefs(); |
| 127 | 110 |
| 128 int ping_delay; | 111 int ping_delay; |
| 129 bool homepage_defined; | 112 bool homepage_defined; |
| 130 int do_import_items; | 113 int do_import_items; |
| 131 int dont_import_items; | 114 int dont_import_items; |
| 132 bool run_search_engine_experiment; | 115 bool run_search_engine_experiment; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // is running. | 157 // is running. |
| 175 static void DoDelayedInstallExtensions(); | 158 static void DoDelayedInstallExtensions(); |
| 176 | 159 |
| 177 #endif | 160 #endif |
| 178 | 161 |
| 179 // This class is for scoping purposes. | 162 // This class is for scoping purposes. |
| 180 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); | 163 DISALLOW_IMPLICIT_CONSTRUCTORS(FirstRun); |
| 181 }; | 164 }; |
| 182 | 165 |
| 183 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ | 166 #endif // CHROME_BROWSER_FIRST_RUN_FIRST_RUN_H_ |
| OLD | NEW |