#ifndef FramePrivate_h
#define FramePrivate_h
#include "CSSMutableStyleDeclaration.h"
#include "CachePolicy.h"
#include "DOMWindow.h"
#include "Decoder.h"
#include "EditCommand.h"
#include "Frame.h"
#include "FrameTree.h"
#include "Plugin.h"
#include "SelectionController.h"
#include "StringHash.h"
#include "Timer.h"
#include "kjs_proxy.h"
#include "kjs_window.h"
#include <wtf/HashMap.h>
const double cLayoutScheduleThreshold = 0.750;
const double tokenizerTimeDelay = 0.500;
namespace WebCore {
class UserStyleSheetLoader;
enum RedirectionScheduled {
noRedirectionScheduled,
redirectionScheduled,
locationChangeScheduled,
historyNavigationScheduled,
locationChangeScheduledDuringLoad
};
class FramePrivate {
public:
FramePrivate(Page* page, Frame* parent, Frame* thisFrame, Element* ownerElement)
: m_page(page)
, m_treeNode(thisFrame, parent)
, m_ownerElement(ownerElement)
, m_extension(0)
, m_jscript(0)
, m_runningScripts(0)
, m_bJScriptEnabled(true)
, m_bJavaEnabled(true)
, m_bPluginsEnabled(true)
, m_settings(0)
, m_bComplete(true)
, m_bLoadingMainResource(false)
, m_bLoadEventEmitted(true)
, m_bUnloadEventEmitted(true)
, m_haveEncoding(false)
, m_bHTTPRefresh(false)
, m_redirectLockHistory(false)
, m_redirectUserGesture(false)
, m_cachePolicy(CachePolicyVerify)
, m_redirectionTimer(thisFrame, &Frame::redirectionTimerFired)
, m_scheduledRedirection(noRedirectionScheduled)
, m_delayRedirect(0)
, m_zoomFactor(parent ? parent->d->m_zoomFactor : 100)
, m_submitForm(0)
, m_bMousePressed(false)
, m_caretBlinkTimer(thisFrame, &Frame::caretBlinkTimerFired)
, m_caretVisible(false)
, m_caretBlinks(true)
, m_caretPaint(true)
, m_bFirstData(true)
, m_bCleared(true)
, m_isActive(false)
, m_opener(0)
, m_openedByJS(false)
, m_bPendingChildRedirection(false)
, m_executingJavaScriptFormAction(false)
, m_cancelWithLoadInProgress(false)
, m_overflowAutoScrollTimer(thisFrame, &Frame::overflowAutoScrollTimerFired)
, m_layoutInterval(cLayoutScheduleThreshold)
, m_maxParseDuration(tokenizerTimeDelay)
, m_savedPausedTimeouts(0)
, m_viewportArguments()
, m_lifeSupportTimer(thisFrame, &Frame::lifeSupportTimerFired)
, m_userStyleSheetLoader(0)
, m_autoscrollTimer(thisFrame, &Frame::autoscrollTimerFired)
, m_autoscrollLayer(0)
, m_paintRestriction(PaintRestrictionNone)
, m_markedTextUsesUnderlines(false)
, m_highlightTextMatches(false)
, m_windowHasFocus(false)
, m_inViewSourceMode(false)
, frameCount(0)
, m_prohibitsScrolling(false)
{
}
~FramePrivate()
{
delete m_extension;
delete m_jscript;
if (m_savedPausedTimeouts)
delete m_savedPausedTimeouts;
}
Page* m_page;
FrameTree m_treeNode;
RefPtr<DOMWindow> m_domWindow;
Vector<RefPtr<Plugin> > m_plugins;
Element* m_ownerElement;
RefPtr<FrameView> m_view;
BrowserExtension* m_extension;
RefPtr<Document> m_doc;
RefPtr<Decoder> m_decoder;
DeprecatedString m_encoding;
DeprecatedString scheduledScript;
RefPtr<Node> scheduledScriptNode;
KJSProxy* m_jscript;
int m_runningScripts;
bool m_bJScriptEnabled : 1;
bool m_bJavaEnabled : 1;
bool m_bPluginsEnabled : 1;
Settings* m_settings;
HashMap<String, String> m_metaData;
String m_kjsStatusBarText;
String m_kjsDefaultStatusBarText;
String m_lastModified;
bool m_bComplete : 1;
bool m_bLoadingMainResource : 1;
bool m_bLoadEventEmitted : 1;
bool m_bUnloadEventEmitted : 1;
bool m_haveEncoding : 1;
bool m_bHTTPRefresh : 1;
bool m_redirectLockHistory : 1;
bool m_redirectUserGesture : 1;
KURL m_url;
KURL m_workingURL;
ResourceRequest m_request;
CachePolicy m_cachePolicy;
Timer<Frame> m_redirectionTimer;
RedirectionScheduled m_scheduledRedirection;
double m_delayRedirect;
DeprecatedString m_redirectURL;
DeprecatedString m_redirectReferrer;
int m_scheduledHistoryNavigationSteps;
int m_zoomFactor;
DeprecatedString m_referrer;
struct SubmitForm {
const char* submitAction;
String submitUrl;
FormData submitFormData;
String target;
String submitContentType;
String submitBoundary;
};
SubmitForm* m_submitForm;
bool m_bMousePressed;
RefPtr<Node> m_mousePressNode;
TextGranularity m_selectionGranularity;
bool m_beganSelectingText;
SelectionController m_selection;
Selection m_mark;
Timer<Frame> m_caretBlinkTimer;
bool m_caretVisible : 1;
bool m_caretBlinks : 1;
bool m_caretPaint : 1;
bool m_bFirstData : 1;
bool m_bCleared : 1;
bool m_isActive : 1;
EditCommandPtr m_lastEditCommand;
int m_xPosForVerticalArrowNavigation;
RefPtr<CSSMutableStyleDeclaration> m_typingStyle;
Color m_caretColor;
IntPoint m_dragStartPos;
Frame* m_opener;
HashSet<Frame*> m_openedFrames;
bool m_openedByJS;
bool m_bPendingChildRedirection;
bool m_executingJavaScriptFormAction;
bool m_cancelWithLoadInProgress;
Timer<Frame> m_overflowAutoScrollTimer;
float m_overflowAutoScrollDelta;
IntPoint m_overflowAutoScrollPos;
double m_layoutInterval;
double m_maxParseDuration;
KJS::PausedTimeouts* m_savedPausedTimeouts;
ViewportArguments m_viewportArguments;
Timer<Frame> m_lifeSupportTimer;
KURL m_userStyleSheetLocation;
UserStyleSheetLoader* m_userStyleSheetLoader;
Timer<Frame> m_autoscrollTimer;
RenderLayer* m_autoscrollLayer;
RefPtr<Node> m_elementToDraw;
PaintRestriction m_paintRestriction;
HashMap<String, String> m_formValuesAboutToBeSubmitted;
RefPtr<Element> m_formAboutToBeSubmitted;
KURL m_submittedFormURL;
bool m_markedTextUsesUnderlines;
DeprecatedValueList<MarkedTextUnderline> m_markedTextUnderlines;
bool m_highlightTextMatches;
bool m_windowHasFocus;
bool m_inViewSourceMode;
unsigned frameCount;
bool m_prohibitsScrolling;
bool m_singleLineSelectionBehavior;
};
}
#endif