Bug 1434167 - remove home page code from the migration wizard, r=MattN

This removes all the homepage-related code. All the cases where we advance the wizard straight to
the homepage wizardpage now go straight to the 'start migrating' page (the 'point' was skipping
earlier pages that allowed users to select items).
The brand bundle was only used by the homepage code so is also being removed.

MozReview-Commit-ID: I9nSU2IMkQz

--HG--
extra : rebase_source : da803ed67b443cb164f2bc55550bfd7c107fa916
This commit is contained in:
Gijs Kruitbosch 2018-02-07 10:37:20 +00:00
Родитель ac1ce88bcf
Коммит 9239725b9a
4 изменённых файлов: 5 добавлений и 115 удалений

Просмотреть файл

@ -7,10 +7,4 @@ brandShortName=Firefox
brandFullName=Mozilla Firefox
vendorShortName=Mozilla
homePageSingleStartMain=Firefox Start, a fast home page with built-in search
homePageImport=Import your home page from %S
homePageMigrationPageTitle=Home Page Selection
homePageMigrationDescription=Please select the home page you wish to use:
syncBrandShortName=Sync

Просмотреть файл

@ -172,12 +172,12 @@ var MigrationWizard = { /* exported MigrationWizard */
// check for more than one source profile
var sourceProfiles = this.spinResolve(this._migrator.getSourceProfiles());
if (this._skipImportSourcePage) {
this._wiz.currentPage.next = "homePageImport";
this._wiz.currentPage.next = "migrating";
} else if (sourceProfiles && sourceProfiles.length > 1) {
this._wiz.currentPage.next = "selectProfile";
} else {
if (this._autoMigrate)
this._wiz.currentPage.next = "homePageImport";
this._wiz.currentPage.next = "migrating";
else
this._wiz.currentPage.next = "importItems";
@ -233,7 +233,7 @@ var MigrationWizard = { /* exported MigrationWizard */
// If we're automigrating or just doing bookmarks don't show the item selection page
if (this._autoMigrate)
this._wiz.currentPage.next = "homePageImport";
this._wiz.currentPage.next = "migrating";
},
// 3 - ImportItems
@ -288,66 +288,7 @@ var MigrationWizard = { /* exported MigrationWizard */
this._wiz.canAdvance = oneChecked;
},
// 4 - Home Page Selection
onHomePageMigrationPageShow() {
// only want this on the first run
if (!this._autoMigrate) {
this._wiz.advance();
return;
}
var brandBundle = document.getElementById("brandBundle");
var pageTitle, pageDesc, mainStr;
// These strings don't exist when not using official branding. If that's
// the case, just skip this page.
try {
pageTitle = brandBundle.getString("homePageMigrationPageTitle");
pageDesc = brandBundle.getString("homePageMigrationDescription");
mainStr = brandBundle.getString("homePageSingleStartMain");
} catch (e) {
this._wiz.advance();
return;
}
document.getElementById("homePageImport").setAttribute("label", pageTitle);
document.getElementById("homePageImportDesc").setAttribute("value", pageDesc);
this._wiz._adjustWizardHeader();
var singleStart = document.getElementById("homePageSingleStart");
singleStart.setAttribute("label", mainStr);
singleStart.setAttribute("value", "DEFAULT");
var appName = MigrationUtils.getBrowserName(this._source);
// semi-wallpaper for crash when multiple profiles exist, since we haven't initialized mSourceProfile in places
this.spinResolve(this._migrator.getMigrateData(this._selectedProfile, this._autoMigrate));
var oldHomePageURL = null;
if (oldHomePageURL && appName) {
var oldHomePageLabel =
brandBundle.getFormattedString("homePageImport", [appName]);
var oldHomePage = document.getElementById("oldHomePage");
oldHomePage.setAttribute("label", oldHomePageLabel);
oldHomePage.setAttribute("value", oldHomePageURL);
oldHomePage.removeAttribute("hidden");
} else {
// if we don't have at least two options, just advance
this._wiz.advance();
}
},
onHomePageMigrationPageAdvanced() {
// we might not have a selectedItem if we're in fallback mode
try {
var radioGroup = document.getElementById("homePageRadiogroup");
this._newHomePage = radioGroup.selectedItem.value;
} catch (ex) {}
},
// 5 - Migrating
// 4 - Migrating
onMigratingPageShow() {
this._wiz.getButton("cancel").disabled = true;
this._wiz.canRewind = false;
@ -432,27 +373,6 @@ var MigrationWizard = { /* exported MigrationWizard */
}
}
if (this._autoMigrate) {
let hasImportedHomepage = !!(this._newHomePage && this._newHomePage != "DEFAULT");
Services.telemetry.getKeyedHistogramById("FX_MIGRATION_IMPORTED_HOMEPAGE")
.add(this._source, hasImportedHomepage);
if (this._newHomePage) {
try {
// set homepage properly
if (this._newHomePage == "DEFAULT") {
Services.prefs.clearUserPref("browser.startup.homepage");
} else {
Services.prefs.setStringPref("browser.startup.homepage",
this._newHomePage);
}
var prefFile = Services.dirsvc.get("ProfDS", Components.interfaces.nsIFile);
prefFile.append("prefs.js");
Services.prefs.savePrefFile(prefFile);
} catch (ex) {
dump(ex);
}
}
// We're done now.
this._wiz.canAdvance = true;
this._wiz.advance();

Просмотреть файл

@ -19,8 +19,6 @@
<script type="application/javascript" src="chrome://browser/content/migration/migration.js"/>
<stringbundle id="brandBundle" src="chrome://branding/locale/brand.properties"/>
<wizardpage id="importSource" pageid="importSource" next="selectProfile"
label="&importSource.title;"
onpageadvanced="return MigrationWizard.onImportSourcePageAdvanced();">
@ -68,7 +66,7 @@
</wizardpage>
<wizardpage id="importItems" pageid="importItems" label="&importItems.title;"
next="homePageImport"
next="migrating"
onpageshow="return MigrationWizard.onImportItemsPageShow();"
onpagerewound="return MigrationWizard.onImportItemsPageRewound();"
onpageadvanced="return MigrationWizard.onImportItemsPageAdvanced();"
@ -78,18 +76,6 @@
<vbox id="dataSources" style="overflow: auto; -moz-appearance: listbox" align="left" flex="1" role="group"/>
</wizardpage>
<wizardpage id="homePageImport" pageid="homePageImport"
next="migrating"
onpageshow="return MigrationWizard.onHomePageMigrationPageShow();"
onpageadvanced="return MigrationWizard.onHomePageMigrationPageAdvanced();">
<description id="homePageImportDesc" control="homePageRadioGroup"/>
<radiogroup id="homePageRadiogroup">
<radio id="homePageSingleStart" selected="true" />
<radio id="oldHomePage" hidden="true" />
</radiogroup>
</wizardpage>
<wizardpage id="migrating" pageid="migrating" label="&migrating.title;"
next="done"
onpageshow="MigrationWizard.onMigratingPageShow();">

Просмотреть файл

@ -6260,16 +6260,6 @@
"releaseChannelCollection": "opt-out",
"description": "Usage of migration for each datatype when migration is run through the post-firstrun flow which allows individual datatypes, keyed by the string description of the browser."
},
"FX_MIGRATION_IMPORTED_HOMEPAGE": {
"record_in_processes": ["main", "content"],
"bug_numbers": [731025, 1298208],
"alert_emails": ["gijs@mozilla.com"],
"expires_in_version": "65",
"kind": "boolean",
"keyed": true,
"releaseChannelCollection": "opt-out",
"description": "Whether the homepage was imported during browser migration. Only available on release builds during firstrun."
},
"FX_MIGRATION_BOOKMARKS_IMPORT_MS": {
"record_in_processes": ["main", "content"],
"bug_numbers": [1289436],