зеркало из https://github.com/mozilla/gecko-dev.git
use the NS_WITH_SERVICE macro. #15042
remove calls to toolkit appcore, as it is going away soon. #14999
This commit is contained in:
Родитель
14554c992d
Коммит
979446d392
|
@ -55,10 +55,10 @@ function open() {
|
||||||
browser.loadUrl( url );
|
browser.loadUrl( url );
|
||||||
|
|
||||||
/* Close dialog. */
|
/* Close dialog. */
|
||||||
toolkit.CloseWindow( window );
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancel() {
|
function cancel() {
|
||||||
toolkit.CloseWindow( window );
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,13 +161,9 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog()
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
// Get app shell service.
|
// Get app shell service.
|
||||||
nsIAppShellService *appShell;
|
NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv);
|
||||||
rv = nsServiceManager::GetService( kAppShellServiceCID,
|
if (NS_FAILED(rv)) return rv;
|
||||||
nsIAppShellService::GetIID(),
|
|
||||||
(nsISupports**)&appShell );
|
|
||||||
|
|
||||||
if ( NS_SUCCEEDED( rv ) )
|
|
||||||
{
|
|
||||||
// Open "progress" dialog.
|
// Open "progress" dialog.
|
||||||
nsCOMPtr <nsIURI> url;
|
nsCOMPtr <nsIURI> url;
|
||||||
const char *urlSpec = "resource:/res/profile/progress_undetermined.xul";
|
const char *urlSpec = "resource:/res/profile/progress_undetermined.xul";
|
||||||
|
@ -201,13 +197,7 @@ nsPrefMigrationProgressDialog::CreateProfileProgressDialog()
|
||||||
DEBUG_PRINTF( PR_STDOUT, "Error creating progress dialog, rv=0x%X\n", (int)rv );
|
DEBUG_PRINTF( PR_STDOUT, "Error creating progress dialog, rv=0x%X\n", (int)rv );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nsServiceManager::ReleaseService( kAppShellServiceCID, appShell );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DEBUG_PRINTF( PR_STDOUT, "Unable to get app shell service, rv=0x%X\n", (int)rv );
|
|
||||||
}
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,22 +205,11 @@ NS_IMETHODIMP
|
||||||
nsPrefMigrationProgressDialog::KillProfileProgressDialog()
|
nsPrefMigrationProgressDialog::KillProfileProgressDialog()
|
||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
nsIAppShellService *appShell;
|
NS_WITH_SERVICE(nsIAppShellService, appShell, kAppShellServiceCID, &rv);
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
rv = nsServiceManager::GetService( kAppShellServiceCID,
|
|
||||||
nsIAppShellService::GetIID(),
|
|
||||||
(nsISupports**)&appShell );
|
|
||||||
|
|
||||||
if ( NS_SUCCEEDED( rv ) )
|
rv = appShell->CloseTopLevelWindow( mWindow );
|
||||||
{
|
return rv;
|
||||||
rv = appShell->CloseTopLevelWindow( mWindow );
|
|
||||||
nsServiceManager::ReleaseService(kAppShellServiceCID, appShell);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DEBUG_PRINTF( PR_STDOUT, "Unable to get app shell service, rv=0x%X\n", (int)rv );
|
|
||||||
}
|
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче