コード例 #1
0
ファイル: BrowserApp.cpp プロジェクト: koletzky/haiku
BrowserApp::BrowserApp()
	:
	BApplication(kApplicationSignature),
	fWindowCount(0),
	fLastWindowFrame(50, 50, 950, 750),
	fLaunchRefsMessage(0),
	fInitialized(false),
	fSettings(NULL),
	fCookies(NULL),
	fSession(NULL),
	fContext(NULL),
	fDownloadWindow(NULL),
	fSettingsWindow(NULL),
	fConsoleWindow(NULL),
	fCookieWindow(NULL)
{
#if ENABLE_NATIVE_COOKIES
	BString cookieStorePath = kApplicationName;
	cookieStorePath << "/Cookies";
	fCookies = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
		cookieStorePath.String());
	BMessage cookieArchive = fCookies->GetValue("cookies", cookieArchive);
	fContext = new BUrlContext();
	fContext->SetCookieJar(BNetworkCookieJar(&cookieArchive));
#endif

	BString sessionStorePath = kApplicationName;
	sessionStorePath << "/Session";
	fSession = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
		sessionStorePath.String());
}
コード例 #2
0
ファイル: BrowserApp.cpp プロジェクト: looncraz/haiku
BrowserApp::BrowserApp()
	:
	BApplication(kApplicationSignature),
	fWindowCount(0),
	fLastWindowFrame(50, 50, 950, 750),
	fLaunchRefsMessage(0),
	fInitialized(false),
	fSettings(NULL),
	fCookies(NULL),
	fSession(NULL),
	fContext(NULL),
	fDownloadWindow(NULL),
	fSettingsWindow(NULL),
	fConsoleWindow(NULL),
	fCookieWindow(NULL)
{
#ifdef __INTEL__
	// First let's check SSE2 is available
	cpuid_info info;
	get_cpuid(&info, 1, 0);

	if ((info.eax_1.features & (1 << 26)) == 0) {
		BAlert alert(B_TRANSLATE("No SSE2 support"), B_TRANSLATE("Your CPU is "
			"too old and does not support the SSE2 extensions, without which "
			"WebPositive cannot run. We recommend installing NetSurf instead."),
			B_TRANSLATE("Darn!"));
		alert.Go();
		exit(-1);
	}
#endif

#if ENABLE_NATIVE_COOKIES
	BString cookieStorePath = kApplicationName;
	cookieStorePath << "/Cookies";
	fCookies = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
		cookieStorePath.String());
	fContext = new BUrlContext();
	if (fCookies->InitCheck() == B_OK) {
		BMessage cookieArchive = fCookies->GetValue("cookies", cookieArchive);
		fContext->SetCookieJar(BNetworkCookieJar(&cookieArchive));
	}
#endif

	BString sessionStorePath = kApplicationName;
	sessionStorePath << "/Session";
	fSession = new SettingsMessage(B_USER_SETTINGS_DIRECTORY,
		sessionStorePath.String());
}