mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
merge backout
This commit is contained in:
commit
dba989ee2b
@ -1107,11 +1107,7 @@ function prepareForStartup() {
|
||||
gBrowser.browsers[0].removeAttribute("disablehistory");
|
||||
|
||||
// enable global history
|
||||
try {
|
||||
gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;
|
||||
} catch(ex) {
|
||||
Components.utils.reportError("Places database may be locked: " + ex);
|
||||
}
|
||||
gBrowser.docShell.QueryInterface(Components.interfaces.nsIDocShellHistory).useGlobalHistory = true;
|
||||
|
||||
// hook up UI through progress listener
|
||||
gBrowser.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
|
||||
|
@ -74,26 +74,12 @@ function BrowserGlue() {
|
||||
}
|
||||
|
||||
BrowserGlue.prototype = {
|
||||
__prefs: null,
|
||||
get _prefs() {
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
this.__defineGetter__("_prefs", function() prefs);
|
||||
return this._prefs;
|
||||
},
|
||||
|
||||
get _placesBundle() {
|
||||
var strings = Cc["@mozilla.org/intl/stringbundle;1"].
|
||||
getService(Ci.nsIStringBundleService).
|
||||
createBundle("chrome://browser/locale/places/places.properties");
|
||||
this.__defineGetter__("_placesBundle", function() strings);
|
||||
return this._placesBundle;
|
||||
},
|
||||
|
||||
get _idleService() {
|
||||
var idleSvc = Cc["@mozilla.org/widget/idleservice;1"].
|
||||
getService(Ci.nsIIdleService);
|
||||
this.__defineGetter__("_idleService", function() idleSvc);
|
||||
return this._idleService;
|
||||
if (!this.__prefs)
|
||||
this.__prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
return this.__prefs;
|
||||
},
|
||||
|
||||
_saveSession: false,
|
||||
@ -146,7 +132,7 @@ BrowserGlue.prototype = {
|
||||
this._initPlaces();
|
||||
break;
|
||||
case "idle":
|
||||
if (this._idleService.idleTime > BOOKMARKS_ARCHIVE_IDLE_TIME * 1000) {
|
||||
if (this.idleService.idleTime > BOOKMARKS_ARCHIVE_IDLE_TIME * 1000) {
|
||||
// Back up bookmarks.
|
||||
this._archiveBookmarks();
|
||||
}
|
||||
@ -229,7 +215,7 @@ BrowserGlue.prototype = {
|
||||
_onProfileShutdown: function()
|
||||
{
|
||||
this._shutdownPlaces();
|
||||
this._idleService.removeIdleObserver(this, BOOKMARKS_ARCHIVE_IDLE_TIME);
|
||||
this.idleService.removeIdleObserver(this, BOOKMARKS_ARCHIVE_IDLE_TIME);
|
||||
this.Sanitizer.onShutdown();
|
||||
},
|
||||
|
||||
@ -259,17 +245,6 @@ BrowserGlue.prototype = {
|
||||
ww.openWindow(null, EMURL, "_blank", EMFEATURES, args);
|
||||
this._prefs.clearUserPref(PREF_EM_NEW_ADDONS_LIST);
|
||||
}
|
||||
|
||||
// Load the "more info" page for a locked places.sqlite
|
||||
if (this._showPlacesLockedPage) {
|
||||
var helpTopic = "places-locked";
|
||||
var url = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
|
||||
getService(Components.interfaces.nsIURLFormatter).
|
||||
formatURLPref("app.support.baseURL");
|
||||
url += helpTopic;
|
||||
var browser = this.getMostRecentBrowserWindow().gBrowser;
|
||||
browser.selectedTab = browser.addTab(url);
|
||||
}
|
||||
},
|
||||
|
||||
_onQuitRequest: function(aCancelQuit, aQuitType)
|
||||
@ -473,6 +448,14 @@ BrowserGlue.prototype = {
|
||||
return Sanitizer;
|
||||
},
|
||||
|
||||
_idleService: null,
|
||||
get idleService() {
|
||||
if (!this._idleService)
|
||||
this._idleService = Cc["@mozilla.org/widget/idleservice;1"].
|
||||
getService(Ci.nsIIdleService);
|
||||
return this._idleService;
|
||||
},
|
||||
|
||||
/**
|
||||
* Initialize Places
|
||||
* - imports the bookmarks html file if bookmarks database is empty, try to
|
||||
@ -501,15 +484,9 @@ BrowserGlue.prototype = {
|
||||
getService(Ci.nsINavHistoryService);
|
||||
var databaseStatus = histsvc.databaseStatus;
|
||||
|
||||
if (databaseStatus == histsvc.DATABASE_STATUS_LOCKED) {
|
||||
this._showPlacesLockedAlert();
|
||||
return;
|
||||
}
|
||||
|
||||
// If the database is corrupt or has been newly created we should
|
||||
// import bookmarks.
|
||||
var importBookmarks = databaseStatus == histsvc.DATABASE_STATUS_CREATE ||
|
||||
histsvc.DATABASE_STATUS_CORRUPT;
|
||||
var importBookmarks = databaseStatus != histsvc.DATABASE_STATUS_OK;
|
||||
|
||||
// Check if user or an extension has required to import bookmarks.html
|
||||
var importBookmarksHTML = false;
|
||||
@ -600,7 +577,7 @@ BrowserGlue.prototype = {
|
||||
|
||||
// Initialize bookmark archiving on idle.
|
||||
// Once a day, either on idle or shutdown, bookmarks are backed up.
|
||||
this._idleService.addIdleObserver(this, BOOKMARKS_ARCHIVE_IDLE_TIME);
|
||||
this.idleService.addIdleObserver(this, BOOKMARKS_ARCHIVE_IDLE_TIME);
|
||||
},
|
||||
|
||||
/**
|
||||
@ -652,29 +629,6 @@ BrowserGlue.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the alert for a locked places database.
|
||||
*/
|
||||
_showPlacesLockedAlert: function nsBrowserGlue__showPlacesLockedAlert() {
|
||||
// notify the user
|
||||
var title = this._placesBundle.GetStringFromName("lockPromptTitle");
|
||||
var text = this._placesBundle.GetStringFromName("lockPromptText");
|
||||
var buttonText = this._placesBundle.GetStringFromName("lockPromptInfoButtonText");
|
||||
|
||||
var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"].
|
||||
getService(Ci.nsIPromptService);
|
||||
var flags = promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING +
|
||||
promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_CANCEL;
|
||||
|
||||
var buttonChoice = promptService.confirmEx(null, title, text, flags,
|
||||
buttonText, null , null, null,
|
||||
{value:false});
|
||||
|
||||
// Show "more info" page once the browser has loaded
|
||||
if (buttonChoice == 0)
|
||||
this._showPlacesLockedPage = true;
|
||||
},
|
||||
|
||||
_migrateUI: function bg__migrateUI() {
|
||||
var migration = 0;
|
||||
try {
|
||||
@ -783,10 +737,11 @@ BrowserGlue.prototype = {
|
||||
getService(Ci.nsINavBookmarksService);
|
||||
var annosvc = Cc["@mozilla.org/browser/annotation-service;1"].
|
||||
getService(Ci.nsIAnnotationService);
|
||||
var strings = this._placesBundle;
|
||||
|
||||
var callback = {
|
||||
_placesBundle: strings,
|
||||
_placesBundle: Cc["@mozilla.org/intl/stringbundle;1"].
|
||||
getService(Ci.nsIStringBundleService).
|
||||
createBundle("chrome://browser/locale/places/places.properties"),
|
||||
|
||||
_uri: function(aSpec) {
|
||||
return Cc["@mozilla.org/network/io-service;1"].
|
||||
|
@ -118,7 +118,3 @@ tagResultLabel=Tag
|
||||
# for url bar autocomplete results of type "bookmark"
|
||||
# See createResultLabel() in urlbarBindings.xml
|
||||
bookmarkResultLabel=Bookmark
|
||||
|
||||
lockPromptTitle=Browser Startup Error
|
||||
lockPromptText=The bookmarks and history system will not be functional because one of Firefox's files is in use by another application. Some security software can cause this problem.
|
||||
lockPromptInfoButtonText=Learn More
|
||||
|
@ -1118,11 +1118,6 @@ interface nsINavHistoryService : nsISupports
|
||||
*/
|
||||
const unsigned short DATABASE_STATUS_CORRUPT = 2;
|
||||
|
||||
/**
|
||||
* Set when database is locked
|
||||
*/
|
||||
const unsigned short DATABASE_STATUS_LOCKED = 3;
|
||||
|
||||
/**
|
||||
* Returns the current database status
|
||||
*/
|
||||
|
@ -626,11 +626,8 @@ nsNavHistory::InitDBFile(PRBool aForceInit)
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = mDBService->OpenUnsharedDatabase(mDBFile, getter_AddRefs(mDBConn));
|
||||
}
|
||||
else if (rv == NS_ERROR_FILE_IS_LOCKED) {
|
||||
mDatabaseStatus = DATABASE_STATUS_LOCKED;
|
||||
}
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user