Set same page group as the caller page when creating window
authorTaeyun An <ty.an@samsung.com>
Mon, 3 Jun 2013 10:20:13 +0000 (19:20 +0900)
committerTaeyun An <ty.an@samsung.com>
Mon, 3 Jun 2013 10:28:02 +0000 (19:28 +0900)
[Title] Set same page group as the caller page when creating window
[Issue#] N_SE-37344
[Problem] A blank window is created when clicking the score link in livescore.com
[Cause] WebCore cannot find out the "target" for the created window
        because the page group for the new window is not same as the previous window.
[Solution] Set same page group as the caller page when creating window

Change-Id: I5f48070b8f1cc24bf4890a3a1589a832a41432af

Source/WTF/wtf/Platform.h
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp

index 556cc65..71dc544 100755 (executable)
@@ -648,6 +648,7 @@ com) : Patch to do not adjust cover rect as fixed pixel size*/
 #endif
 #define ENABLE_TIZEN_WEBKIT2_CONTEXT_MENU_TEXT_SELECTION_MODE 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Patchs to add "Text selection mode" options to context menu */
 #define ENABLE_TIZEN_WEBKIT2_CREATE_VIEW_WITH_CREATED_PAGE_GROUP_WITH_IDENTIFIER 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Patchs to create view with created page group with identifier */
+#define ENABLE_TIZEN_WEBKIT2_SAME_PAGE_GROUP_FOR_CREATE_WINDOW_OPERATION 1 /* Jongseok Yang (js45.yang@samsung.com) : The page frome create window operation has same page group as the caller page */
 #define ENABLE_TIZEN_WEBKIT2_SEPERATE_LOAD_PROGRESS 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Patchs to seperate load progress callback for supporting OSP requirement  - "load,progress,started", "load,progress", "load,progress,finished" */
 #define ENABLE_TIZEN_WEBKIT2_CONTEXT_MENU_ICON_TYPE_SUPPORT 1 /* Yuni Jeong(yhnet.jung@samsung.com) : Support icon type's option to context menu */
 #define ENABLE_TIZEN_WEBKIT2_LOCAL_IMPLEMENTATION_FOR_ERROR 1 /* Jongseok Yang(js45.yang@samsung.com) : temporary pathes to maintain local implementation for error operation */
index 2ef0edf..0b9d82e 100755 (executable)
@@ -184,7 +184,7 @@ void WebChromeClient::focusedFrameChanged(Frame* frame)
     WebProcess::shared().connection()->send(Messages::WebPageProxy::FocusedFrameChanged(webFrame ? webFrame->frameID() : 0), m_page->pageID());
 }
 
-Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
+Page* WebChromeClient::createWindow(Frame* frame, const FrameLoadRequest& request, const WindowFeatures& windowFeatures, const NavigationAction& navigationAction)
 {
     uint32_t modifiers = static_cast<uint32_t>(InjectedBundleNavigationAction::modifiersForNavigationAction(navigationAction));
     int32_t mouseButton = static_cast<int32_t>(InjectedBundleNavigationAction::mouseButtonForNavigationAction(navigationAction));
@@ -198,6 +198,11 @@ Page* WebChromeClient::createWindow(Frame*, const FrameLoadRequest& request, con
         return 0;
 
     WebProcess::shared().createWebPage(newPageID, parameters);
+#if ENABLE(TIZEN_WEBKIT2_SAME_PAGE_GROUP_FOR_CREATE_WINDOW_OPERATION)
+    WebCore::Page* page = WebProcess::shared().webPage(newPageID)->corePage();
+    page->setGroupName(frame->page()->groupName());
+    return page;
+#endif
     return WebProcess::shared().webPage(newPageID)->corePage();
 }