diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 20:47:58 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-25 20:47:58 +0000 |
commit | 8aaba6608dfe2f1e9faf15a1c72547a20f7435f3 (patch) | |
tree | b2aaf59c336253ce3d354831ddc55334503f9c12 /chrome/browser/first_run_mac.mm | |
parent | 4ccd3199c69cf97bbc11b334162eb5247f6a2306 (diff) | |
download | chromium_src-8aaba6608dfe2f1e9faf15a1c72547a20f7435f3.zip chromium_src-8aaba6608dfe2f1e9faf15a1c72547a20f7435f3.tar.gz chromium_src-8aaba6608dfe2f1e9faf15a1c72547a20f7435f3.tar.bz2 |
Remove old Mac First Run Migration code.
We've gone through 2 dev release cycles so most users should be upgraded by now,
removing code.
Review URL: http://codereview.chromium.org/244011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27240 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run_mac.mm')
-rw-r--r-- | chrome/browser/first_run_mac.mm | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/chrome/browser/first_run_mac.mm b/chrome/browser/first_run_mac.mm index 52e18a6..f46bf4f 100644 --- a/chrome/browser/first_run_mac.mm +++ b/chrome/browser/first_run_mac.mm @@ -15,83 +15,6 @@ #include "chrome/installer/util/google_update_constants.h" #include "chrome/installer/util/google_update_settings.h" -//------------------ Start Temporary Code --------------------- -// The Mac version used to store first run in the user defaults, this has -// now been moved to the profile directory like other platforms. -// These functions are here to use for migration, they should be removed -// in the near future once most people are upgraded. -// This should be removed after 2 dev release cycles following the checkin -// of this code, or by 15-Sept-2009. Whichever comes first. -namespace old_first_run_mac { - -const NSString *kOldUsageStatsPrefName = @"usagestats"; - -// returns true if the first run sentinel is present in the dictionary -// false if no sentinel is present. -// |usage_stats_enabled| - Where the usage stats previously enabled? -bool IsOldChromeFirstRunFromDictionary(NSDictionary *dict, - bool *usage_stats_enabled) { - *usage_stats_enabled = false; - - // Use presence of kOldUsageStatsPrefName key as an indicator of whether or - // not this is the first run. - NSNumber* val = [dict objectForKey:kOldUsageStatsPrefName]; - - if (val == nil) { - return false; - } - - if ([val respondsToSelector:@selector(boolValue)]) { - *usage_stats_enabled = [val boolValue] ? true : false; - } - - return true; -} - -bool IsOldChromeFirstRun(bool *usage_stats_enabled) { - NSUserDefaults* std_defaults = [NSUserDefaults standardUserDefaults]; - NSDictionary* defaults_dict = [std_defaults dictionaryRepresentation]; - - return IsOldChromeFirstRunFromDictionary(defaults_dict, usage_stats_enabled); -} - -// Remove the old first run key from the defaults dictionary. -void RemoveOldFirstRunDefaultsKey() { - NSUserDefaults* std_defaults = [NSUserDefaults standardUserDefaults]; - [std_defaults removeObjectForKey:kOldUsageStatsPrefName]; - [std_defaults synchronize]; -} - -// returns: -// true - If old first run sentinel found and migration was performed. -// false - no previous first run sentinel found. -bool MigrateOldFirstRun() { - bool usage_stats_enabled = false; - - if (!IsOldChromeFirstRun(&usage_stats_enabled)) - return false; - - FirstRun::CreateSentinel(); - GoogleUpdateSettings::SetCollectStatsConsent(usage_stats_enabled); - - // Migrate old first run data. -#if defined(GOOGLE_CHROME_BUILD) - // Breakpad is normally enabled very early in the startup process, - // however, on the first run it's off by default. If the user opts-in to - // stats, enable breakpad. - if (usage_stats_enabled) { - InitCrashReporter(); - InitCrashProcessInfo(); - } -#endif // GOOGLE_CHROME_BUILD - - RemoveOldFirstRunDefaultsKey(); - return true; -} - -} // namespace old_first_run_mac -//------------------ End Temporary Code --------------------- - // Class that handles conducting the first run operation. // FirstRunController deletes itself when the first run operation ends. class FirstRunController : public ImportObserver { @@ -156,13 +79,6 @@ bool FirstRunController::DoFirstRun(Profile* profile, // before this point. Then remove the need for that dialog here. DCHECK(!IsCrashReporterEnabled()); - //------------------ Start Temporary Code --------------------- - // Migrate old first run format. - if (old_first_run_mac::MigrateOldFirstRun()) { - return true; - } - //------------------ End Temporary Code --------------------- - scoped_nsobject<FirstRunDialogController> dialog( [[FirstRunDialogController alloc] init]); |