Bug 1403978 - Add 'searchInNavbar' to the environment's settings section. r?chutten
Adding the related preference to the userPrefs watchlist triggers an
environment change, but does not report the value of the preference if it
was not set by the user (default value). However, since the default value
is changing for new profiles, we need a way to distinguish between the
default for old profiles and the default for new profiles.
MozReview-Commit-ID: 1sHvxh6qgxZ
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -268,16 +268,17 @@ const PREF_DISTRIBUTOR = "app.distributo
const PREF_DISTRIBUTOR_CHANNEL = "app.distributor.channel";
const PREF_HOTFIX_LASTVERSION = "extensions.hotfix.lastVersion";
const PREF_APP_PARTNER_BRANCH = "app.partner.";
const PREF_PARTNER_ID = "mozilla.partner.id";
const PREF_UPDATE_ENABLED = "app.update.enabled";
const PREF_UPDATE_AUTODOWNLOAD = "app.update.auto";
const PREF_SEARCH_COHORT = "browser.search.cohort";
const PREF_E10S_COHORT = "e10s.rollout.cohort";
+const PREF_SEARCH_INNAVBAR = "browser.search.widget.inNavBar";
const COMPOSITOR_CREATED_TOPIC = "compositor:created";
const COMPOSITOR_PROCESS_ABORTED_TOPIC = "compositor:process-aborted";
const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC = "distribution-customization-complete";
const EXPERIMENTS_CHANGED_TOPIC = "experiments-changed";
const GFX_FEATURES_READY_TOPIC = "gfx-features-ready";
const SEARCH_ENGINE_MODIFIED_TOPIC = "browser-search-engine-modified";
const SEARCH_SERVICE_TOPIC = "browser-search-service";
@@ -1379,16 +1380,17 @@ EnvironmentCache.prototype = {
locale: getBrowserLocale(),
update: {
channel: updateChannel,
enabled: Services.prefs.getBoolPref(PREF_UPDATE_ENABLED, true),
autoDownload: Services.prefs.getBoolPref(PREF_UPDATE_AUTODOWNLOAD, true),
},
userPrefs: this._getPrefData(),
sandbox: this._getSandboxData(),
+ searchInNavbar: Services.prefs.getBoolPref(PREF_SEARCH_INNAVBAR, false),
};
this._currentEnvironment.settings.addonCompatibilityCheckEnabled =
AddonManager.checkCompatibility;
this._updateDefaultBrowser();
this._updateSearchEngine();
},
--- a/toolkit/components/telemetry/docs/data/environment.rst
+++ b/toolkit/components/telemetry/docs/data/environment.rst
@@ -66,17 +66,18 @@ Structure:
// all of these values are optional.
source: <string>, // referring partner domain, when install happens via a known partner
medium: <string>, // category of the source, such as "organic" for a search engine
campaign: <string>, // identifier of the particular campaign that led to the download of the product
content: <string>, // identifier to indicate the particular link within a campaign
},
sandbox: {
effectiveContentProcessLevel: <integer>,
- }
+ },
+ searchInNavbar: <bool> // false if the unified searchbar is used, false if 2 bars
},
profile: {
creationDate: <integer>, // integer days since UNIX epoch, e.g. 16446
resetDate: <integer>, // integer days since UNIX epoch, e.g. 16446 - optional
},
partner: { // This section may not be immediately available on startup
distributionId: <string>, // pref "distribution.id", null on failure
distributionVersion: <string>, // pref "distribution.version", null on failure