webengine/osswebengine/WebKit/s60/webview/WebDocumentLoader.cpp
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   DocumentLoader in webkit side
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <../bidi.h>
       
    20 #include "config.h"
       
    21 #include "WebDocumentLoader.h"
       
    22 #include "SubstituteData.h"
       
    23 #include "WebView.h"
       
    24 #include "BrCtl.h"
       
    25 #include "WebCharsetData.h"
       
    26 #include "SettingsContainer.h"
       
    27 #include "WebFrame.h"
       
    28 #include "WebView.h"
       
    29 #include "WebFrameView.h"
       
    30 
       
    31 using namespace WebCore;
       
    32 
       
    33 WebDocumentLoader::WebDocumentLoader(const ResourceRequest& request, const SubstituteData& substituteData)
       
    34     : DocumentLoader(request, substituteData)
       
    35     , m_hasEverBeenDetached(false) , m_userWasAskedToLoadNonSecureItem(false), m_userAgreedToLoadNonSecureItem (false)
       
    36 {
       
    37 }
       
    38 
       
    39 /*
       
    40 void WebDocumentLoader::setDataSource(WebDataSource *dataSource)
       
    41 {
       
    42 
       
    43     ASSERT(!m_dataSource);
       
    44     HardRetain(dataSource);
       
    45     m_dataSource = dataSource;
       
    46     
       
    47     m_resourceLoadDelegate = [webView resourceLoadDelegate];
       
    48     m_downloadDelegate = [webView downloadDelegate];
       
    49 
       
    50     m_dataSource = dataSource;
       
    51 }
       
    52 */
       
    53 void WebDocumentLoader::attachToFrame()
       
    54 {
       
    55     DocumentLoader::attachToFrame();
       
    56     ASSERT(m_loadingResources.isEmpty());
       
    57 /*
       
    58 
       
    59     if (m_hasEverBeenDetached)
       
    60         HardRetain(m_dataSource);
       
    61 */
       
    62     if (control(frame())->settings() && charsetForUid(control(frame())->settings()->brctlSetting(TBrCtlDefs::ESettingsCharacterset))){
       
    63         setOverrideEncoding(TPtrC(charsetForUid(control(frame())->settings()->brctlSetting(TBrCtlDefs::ESettingsCharacterset))));
       
    64     }
       
    65 
       
    66 }
       
    67 
       
    68 void WebDocumentLoader::detachFromFrame()
       
    69 {
       
    70     DocumentLoader::detachFromFrame();
       
    71 /*
       
    72   
       
    73     m_hasEverBeenDetached = true;
       
    74     HardRelease(m_dataSource);
       
    75 */
       
    76 }
       
    77 
       
    78 void WebDocumentLoader::increaseLoadCount(unsigned long identifier)
       
    79 {
       
    80     if (m_loadingResources.contains(identifier))
       
    81         return;
       
    82 /*
       
    83 
       
    84     if (m_loadingResources.isEmpty())
       
    85         HardRetain(m_dataSource);
       
    86 */
       
    87     m_loadingResources.add(identifier);
       
    88 }
       
    89 
       
    90 void WebDocumentLoader::decreaseLoadCount(unsigned long identifier)
       
    91 {
       
    92     m_loadingResources.remove(identifier);
       
    93 /*
       
    94     
       
    95     if (m_loadingResources.isEmpty()) {
       
    96         m_resourceLoadDelegate = 0;
       
    97         m_downloadDelegate = 0;
       
    98         HardRelease(m_dataSource);
       
    99     }
       
   100 */
       
   101 }
       
   102 
       
   103 void WebDocumentLoader::setUserAgreedToLoadNonSecureItem(bool userAgreed)
       
   104 {
       
   105     m_userAgreedToLoadNonSecureItem = userAgreed;
       
   106     m_userWasAskedToLoadNonSecureItem = true;
       
   107 }
       
   108 
       
   109