function setPrefValue(enabled, incognito) {
  var scope = incognito ? 'incognito_session_only' : 'regular';
  pref.set({'value': enabled, 'scope': scope});
}
Called from the UI to change the preference value.

@param enabled{boolean} The new preference value.
@param incognito{boolean} Whether the value is specific to incognito mode.