Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
054164d5
Commit
054164d5
authored
Dec 15, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 15, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Set Gecko's profile.
Make sure that Gecko components are registered.
parent
e76969b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
5 deletions
+67
-5
nsembed.c
dlls/mshtml/nsembed.c
+47
-5
nsiface.idl
dlls/mshtml/nsiface.idl
+20
-0
No files found.
dlls/mshtml/nsembed.c
View file @
054164d5
...
@@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
...
@@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define NS_APPSTARTUPNOTIFIER_CONTRACTID "@mozilla.org/embedcomp/appstartup-notifier;1"
#define NS_APPSTARTUPNOTIFIER_CONTRACTID "@mozilla.org/embedcomp/appstartup-notifier;1"
#define NS_WEBBROWSER_CONTRACTID "@mozilla.org/embedding/browser/nsWebBrowser;1"
#define NS_WEBBROWSER_CONTRACTID "@mozilla.org/embedding/browser/nsWebBrowser;1"
#define NS_IOSERVICE_CONTRACTID "@mozilla.org/network/io-service;1"
#define NS_IOSERVICE_CONTRACTID "@mozilla.org/network/io-service;1"
#define NS_PROFILE_CONTRACTID "@mozilla.org/profile/manager;1"
#define APPSTARTUP_TOPIC "app-startup"
#define APPSTARTUP_TOPIC "app-startup"
...
@@ -210,11 +211,40 @@ static BOOL get_wine_gecko_path(PRUnichar *gre_path)
...
@@ -210,11 +211,40 @@ static BOOL get_wine_gecko_path(PRUnichar *gre_path)
return
TRUE
;
return
TRUE
;
}
}
static
void
set_profile
(
void
)
{
nsIProfile
*
profile
;
PRBool
exists
=
FALSE
;
nsresult
nsres
;
static
const
WCHAR
wszMSHTML
[]
=
{
'M'
,
'S'
,
'H'
,
'T'
,
'M'
,
'L'
,
0
};
nsres
=
nsIServiceManager_GetServiceByContactID
(
pServMgr
,
NS_PROFILE_CONTRACTID
,
&
IID_nsIProfile
,
(
void
**
)
&
profile
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get profile service: %08lx
\n
"
,
nsres
);
return
;
}
nsres
=
nsIProfile_ProfileExists
(
profile
,
wszMSHTML
,
&
exists
);
if
(
!
exists
)
{
nsres
=
nsIProfile_CreateNewProfile
(
profile
,
wszMSHTML
,
NULL
,
NULL
,
FALSE
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"CreateNewProfile failed: %08lx
\n
"
,
nsres
);
}
nsres
=
nsIProfile_SetCurrentProfile
(
profile
,
wszMSHTML
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetCurrentProfile failed: %08lx
\n
"
,
nsres
);
nsIProfile_Release
(
profile
);
}
static
BOOL
load_gecko
()
static
BOOL
load_gecko
()
{
{
nsresult
nsres
;
nsresult
nsres
;
nsIObserver
*
pStartNotif
;
nsIObserver
*
pStartNotif
;
nsIComponentRegistrar
*
registrar
;
nsIComponentRegistrar
*
registrar
=
NULL
;
nsString
path
;
nsString
path
;
nsIFile
*
gre_dir
;
nsIFile
*
gre_dir
;
PRUnichar
gre_path
[
MAX_PATH
];
PRUnichar
gre_path
[
MAX_PATH
];
...
@@ -292,6 +322,19 @@ static BOOL load_gecko()
...
@@ -292,6 +322,19 @@ static BOOL load_gecko()
if
(
NS_FAILED
(
nsres
))
if
(
NS_FAILED
(
nsres
))
ERR
(
"Could not get nsIComponentManager: %08lx
\n
"
,
nsres
);
ERR
(
"Could not get nsIComponentManager: %08lx
\n
"
,
nsres
);
nsres
=
NS_GetComponentRegistrar
(
&
registrar
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIComponentRegistrar_AutoRegister
(
registrar
,
NULL
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"AutoRegister(NULL) failed: %08lx
\n
"
,
nsres
);
nsres
=
nsIComponentRegistrar_AutoRegister
(
registrar
,
gre_dir
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"AutoRegister(gre_dir) failed: %08lx
\n
"
,
nsres
);
}
else
{
ERR
(
"NS_GetComponentRegistrar failed: %08lx
\n
"
,
nsres
);
}
nsres
=
nsIComponentManager_CreateInstanceByContractID
(
pCompMgr
,
NS_APPSTARTUPNOTIFIER_CONTRACTID
,
nsres
=
nsIComponentManager_CreateInstanceByContractID
(
pCompMgr
,
NS_APPSTARTUPNOTIFIER_CONTRACTID
,
NULL
,
&
IID_nsIObserver
,
(
void
**
)
&
pStartNotif
);
NULL
,
&
IID_nsIObserver
,
(
void
**
)
&
pStartNotif
);
if
(
NS_SUCCEEDED
(
nsres
))
{
if
(
NS_SUCCEEDED
(
nsres
))
{
...
@@ -304,14 +347,13 @@ static BOOL load_gecko()
...
@@ -304,14 +347,13 @@ static BOOL load_gecko()
ERR
(
"could not get appstartup-notifier: %08lx
\n
"
,
nsres
);
ERR
(
"could not get appstartup-notifier: %08lx
\n
"
,
nsres
);
}
}
nsres
=
NS_GetComponentRegistrar
(
&
registrar
);
if
(
registrar
)
{
if
(
NS_SUCCEEDED
(
nsres
))
{
register_nsservice
(
registrar
);
register_nsservice
(
registrar
);
nsIComponentRegistrar_Release
(
registrar
);
nsIComponentRegistrar_Release
(
registrar
);
}
else
{
ERR
(
"NS_GetComponentRegistrar failed: %08lx
\n
"
,
nsres
);
}
}
set_profile
();
return
TRUE
;
return
TRUE
;
}
}
...
...
dlls/mshtml/nsiface.idl
View file @
054164d5
...
@@ -515,3 +515,23 @@ interface nsIPromptService : nsISupports
...
@@ -515,3 +515,23 @@ interface nsIPromptService : nsISupports
const PRUnichar *aText, PRUint32 aCount, const PRUnichar **aSelectList,
const PRUnichar *aText, PRUint32 aCount, const PRUnichar **aSelectList,
PRInt32 *aOutSelection, PRBool *_retval);
PRInt32 *aOutSelection, PRBool *_retval);
}
}
[
object,
uuid(02b0625a-e7f3-11d2-9f5a-006008a6efe9)
]
interface nsIProfile : nsISupports
{
nsresult GetProfileCount(PRInt32 *aProfileCount);
nsresult GetProfileList(PRUint32 *length, PRUnichar ***profileNames);
nsresult ProfileExists(const PRUnichar *profileName, PRBool *_retval);
nsresult GetCurrentProfile(PRUnichar * *aCurrentProfile);
nsresult SetCurrentProfile(const PRUnichar * aCurrentProfile);
nsresult ShutDownCurrentProfile(PRUint32 shutDownType);
nsresult CreateNewProfile(const PRUnichar *profileName,
const PRUnichar *nativeProfileDir, const PRUnichar *langcode,
PRBool useExistingDir);
nsresult RenameProfile(const PRUnichar *oldName, const PRUnichar *newName);
nsresult DeleteProfile(const PRUnichar *name, PRBool canDeleteFiles);
nsresult CloneProfile(const PRUnichar *profileName);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment