Reviewed by Anders Carlsson.
Need WebKit2 API for creating a page with a specific main frame name
https://bugs.webkit.org/show_bug.cgi?id=56759
* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
Add mainFrameName to creation parameters.
* UIProcess/API/mac/WKView.h:
* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:]):
(-[WKView initWithFrame:contextRef:]):
(-[WKView initWithFrame:contextRef:pageGroupRef:]):
(-[WKView initWithFrame:contextRef:pageGroupRef:mainFrameName:]):
Add new initializer which takes a main frame name.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setMainFrameName):
(WebKit::WebPageProxy::creationParameters):
* UIProcess/WebPageProxy.h:
Store the main frame name for initialization/re-initialization.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createMainFrame):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Pass the name to main frame creation.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81593
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-03-21 Sam Weinig <sam@webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Need WebKit2 API for creating a page with a specific main frame name
+ https://bugs.webkit.org/show_bug.cgi?id=56759
+
+ * Shared/WebPageCreationParameters.cpp:
+ (WebKit::WebPageCreationParameters::encode):
+ (WebKit::WebPageCreationParameters::decode):
+ * Shared/WebPageCreationParameters.h:
+ Add mainFrameName to creation parameters.
+
+ * UIProcess/API/mac/WKView.h:
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView initWithFrame:]):
+ (-[WKView initWithFrame:contextRef:]):
+ (-[WKView initWithFrame:contextRef:pageGroupRef:]):
+ (-[WKView initWithFrame:contextRef:pageGroupRef:mainFrameName:]):
+ Add new initializer which takes a main frame name.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::setMainFrameName):
+ (WebKit::WebPageProxy::creationParameters):
+ * UIProcess/WebPageProxy.h:
+ Store the main frame name for initialization/re-initialization.
+
+ * WebProcess/WebPage/WebFrame.cpp:
+ (WebKit::WebFrame::createMainFrame):
+ * WebProcess/WebPage/WebFrame.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::WebPage):
+ Pass the name to main frame creation.
+
2011-03-20 Bill Budge <bbudge@chromium.org>
Reviewed by Adam Barth.
encoder->encode(useFixedLayout);
encoder->encode(fixedLayoutSize);
encoder->encode(userAgent);
+ encoder->encode(mainFrameName);
encoder->encode(sessionState);
encoder->encode(highestUsedBackForwardItemID);
encoder->encode(canRunBeforeUnloadConfirmPanel);
return false;
if (!decoder->decode(parameters.userAgent))
return false;
+ if (!decoder->decode(parameters.mainFrameName))
+ return false;
if (!decoder->decode(parameters.sessionState))
return false;
if (!decoder->decode(parameters.highestUsedBackForwardItemID))
WebCore::IntSize fixedLayoutSize;
String userAgent;
+ String mainFrameName;
SessionState sessionState;
uint64_t highestUsedBackForwardItemID;
- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef;
- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef;
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef mainFrameName:(NSString *)mainFrameName;
- (NSPrintOperation *)printOperationWithPrintInfo:(NSPrintInfo *)printInfo forFrame:(WKFrameRef)frameRef;
- (BOOL)canChangeFrameLayout:(WKFrameRef)frameRef;
return true;
}
-- (id)initWithFrame:(NSRect)frame
-{
- return [self initWithFrame:frame contextRef:toAPI(WebContext::sharedProcessContext())];
-}
-
-- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef
-{
- return [self initWithFrame:frame contextRef:contextRef pageGroupRef:nil];
-}
-
- (void)_registerDraggedTypes
{
NSMutableSet *types = [[NSMutableSet alloc] initWithArray:PasteboardTypes::forEditing()];
#endif
}
+- (id)initWithFrame:(NSRect)frame
+{
+ return [self initWithFrame:frame contextRef:toAPI(WebContext::sharedProcessContext())];
+}
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef
+{
+ return [self initWithFrame:frame contextRef:contextRef pageGroupRef:nil];
+}
+
- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef
+{
+ return [self initWithFrame:frame contextRef:contextRef pageGroupRef:pageGroupRef mainFrameName:nil];
+}
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)contextRef pageGroupRef:(WKPageGroupRef)pageGroupRef mainFrameName:(NSString *)mainFrameName
{
self = [super initWithFrame:frame];
if (!self)
_data->_pageClient = PageClientImpl::create(self);
_data->_page = toImpl(contextRef)->createWebPage(_data->_pageClient.get(), toImpl(pageGroupRef));
+ _data->_page->setMainFrameName(mainFrameName);
_data->_page->initializeWebPage();
+
#if ENABLE(FULLSCREEN_API)
_data->_page->fullScreenManager()->setWebView(self);
#endif
process()->send(Messages::WebPage::SetCustomTextEncodingName(encodingName), m_pageID);
}
+void WebPageProxy::setMainFrameName(const String& mainFrameName)
+{
+ m_mainFrameName = mainFrameName;
+}
+
void WebPageProxy::terminateProcess()
{
if (!isValid())
parameters.useFixedLayout = m_useFixedLayout;
parameters.fixedLayoutSize = m_fixedLayoutSize;
parameters.userAgent = userAgent();
+ parameters.mainFrameName = m_mainFrameName;
parameters.sessionState = SessionState(m_backForwardList->entries(), m_backForwardList->currentIndex());
parameters.highestUsedBackForwardItemID = WebBackForwardListItem::highedUsedItemID();
parameters.canRunBeforeUnloadConfirmPanel = m_uiClient.canRunBeforeUnloadConfirmPanel();
void setCustomTextEncodingName(const String&);
String customTextEncodingName() const { return m_customTextEncodingName; }
+ void setMainFrameName(const String&);
+
double estimatedProgress() const;
void terminateProcess();
String m_applicationNameForUserAgent;
String m_customUserAgent;
String m_customTextEncodingName;
+ String m_mainFrameName;
#if ENABLE(INSPECTOR)
RefPtr<WebInspectorProxy> m_inspector;
return uniqueListenerID++;
}
-PassRefPtr<WebFrame> WebFrame::createMainFrame(WebPage* page)
+PassRefPtr<WebFrame> WebFrame::createMainFrame(WebPage* page, const String& frameName)
{
RefPtr<WebFrame> frame = create();
page->send(Messages::WebPageProxy::DidCreateMainFrame(frame->frameID()));
- frame->init(page, String(), 0);
+ frame->init(page, frameName, 0);
return frame.release();
}
public:
static const Type APIType = TypeBundleFrame;
- static PassRefPtr<WebFrame> createMainFrame(WebPage*);
+ static PassRefPtr<WebFrame> createMainFrame(WebPage*, const String& frameName);
static PassRefPtr<WebFrame> createSubframe(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
~WebFrame();
Settings::setDefaultMinDOMTimerInterval(0.004);
m_drawingArea = DrawingArea::create(this, parameters);
- m_mainFrame = WebFrame::createMainFrame(this);
+ m_mainFrame = WebFrame::createMainFrame(this, parameters.mainFrameName);
setDrawsBackground(parameters.drawsBackground);
setDrawsTransparentBackground(parameters.drawsTransparentBackground);