зеркало из https://github.com/mozilla/pjs.git
[MANTICORE] pref-based layout engine switching. [Not part of build]
This commit is contained in:
Родитель
07cdec99dd
Коммит
9f0bb0208a
|
@ -29,7 +29,7 @@ namespace Silverstone.Manticore.App
|
||||||
|
|
||||||
// Initialize default and user preferences
|
// Initialize default and user preferences
|
||||||
mPreferences = new Preferences();
|
mPreferences = new Preferences();
|
||||||
// mPreferences.InitializeDefaults("default-prefs.xml");
|
mPreferences.InitializeDefaults("default-prefs.xml");
|
||||||
mPreferences.LoadPreferencesFile("user-prefs.xml");
|
mPreferences.LoadPreferencesFile("user-prefs.xml");
|
||||||
|
|
||||||
OpenNewBrowser();
|
OpenNewBrowser();
|
||||||
|
|
|
@ -113,7 +113,7 @@ namespace Silverstone.Manticore.BrowserWindow
|
||||||
statusBar.Panels.AddRange(new StatusBarPanel[] {docStatePanel, statusPanel, progressPanel, zonePanel});
|
statusBar.Panels.AddRange(new StatusBarPanel[] {docStatePanel, statusPanel, progressPanel, zonePanel});
|
||||||
statusBar.ShowPanels = true;
|
statusBar.ShowPanels = true;
|
||||||
|
|
||||||
webBrowser = new WebBrowser();
|
webBrowser = new WebBrowser(this);
|
||||||
this.Controls.Add(webBrowser);
|
this.Controls.Add(webBrowser);
|
||||||
|
|
||||||
this.Controls.Add(statusBar);
|
this.Controls.Add(statusBar);
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
|
||||||
|
<prefs xmlns="http://www.silverstone.net.nz/2001/manticore/uidl">
|
||||||
|
<stringpref name="browser.homepage" value="http://www.nissan.co.jp/SILVIA/"/>
|
||||||
|
<intpref name="browser.homepage.mode" value="1"/>
|
||||||
|
<stringpref name="browser.layoutengine" value="gecko"/>
|
||||||
|
</prefs>
|
|
@ -49,20 +49,29 @@ namespace Silverstone.Manticore.LayoutAbstraction
|
||||||
using AxMOZILLACONTROLLib;
|
using AxMOZILLACONTROLLib;
|
||||||
using MOZILLACONTROLLib;
|
using MOZILLACONTROLLib;
|
||||||
|
|
||||||
|
using Silverstone.Manticore.BrowserWindow;
|
||||||
|
|
||||||
public class WebBrowser : ContainerControl
|
public class WebBrowser : ContainerControl
|
||||||
{
|
{
|
||||||
private AxWebBrowser trident;
|
private AxWebBrowser trident;
|
||||||
private AxMozillaBrowser gecko;
|
private AxMozillaBrowser gecko;
|
||||||
|
|
||||||
public WebBrowser()
|
private BrowserWindow mBrowserWindow;
|
||||||
|
|
||||||
|
public WebBrowser(BrowserWindow aBrowserWindow)
|
||||||
{
|
{
|
||||||
|
mBrowserWindow = aBrowserWindow;
|
||||||
this.Dock = DockStyle.Fill;
|
this.Dock = DockStyle.Fill;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RealizeLayoutEngine()
|
public void RealizeLayoutEngine()
|
||||||
{
|
{
|
||||||
if (gecko == null && trident == null)
|
if (gecko == null && trident == null) {
|
||||||
SwitchLayoutEngine("gecko"); // XXX Should be pref-based.
|
String layoutEngine = mBrowserWindow.application.Prefs.GetStringPref("browser.layoutengine");
|
||||||
|
if (layoutEngine == "")
|
||||||
|
layoutEngine = "gecko";
|
||||||
|
SwitchLayoutEngine(layoutEngine);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SwitchLayoutEngine(String id)
|
public void SwitchLayoutEngine(String id)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче