# HG changeset patch # User hgs # Date 1282309506 -10800 # Node ID 2625ef7905cb030622c1da07941df75d2b587a60 # Parent 5ce76b96936980c49a6ba56b623e166e77e67a28 201033_02 diff -r 5ce76b969369 -r 2625ef7905cb drm_plat/drm_common_api/tsrc/data/mmc/DRM/content.dcf diff -r 5ce76b969369 -r 2625ef7905cb drm_plat/drm_rights_api/tsrc/data/c/content.dcf diff -r 5ce76b969369 -r 2625ef7905cb drm_pub/oma_drm_caf_agent_api/tsrc/bc/DRM_CAF/data/content.dcf diff -r 5ce76b969369 -r 2625ef7905cb wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowsercontainer.h --- a/wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowsercontainer.h Fri Aug 20 11:00:50 2010 +0300 +++ b/wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowsercontainer.h Fri Aug 20 16:05:06 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,56 +22,22 @@ #include class CAknView; -class MBrCtlSpecialLoadObserver; -class CBrCtlInterface; class CWmDrmDlaBrowserContainer : public CCoeControl { public: - static CWmDrmDlaBrowserContainer* NewL( CAknView* aView, - MBrCtlSpecialLoadObserver* aObserver ); - static CWmDrmDlaBrowserContainer* NewLC( CAknView* aView, - MBrCtlSpecialLoadObserver* aObserver ); - - /** - * Destructor. - */ - virtual ~CWmDrmDlaBrowserContainer(); - - /** - * Returns pointer to the CBrCtlInterface owned by the container. - * @return A pointer to CBrCtlInterface - */ - CBrCtlInterface* BrCtlInterface(); - - public: // From CCoeControl /** * @see CCoeControl */ - TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); - - /** - * @see CCoeControl - */ - TInt CountComponentControls() const; - - /** - * @see CCoeControl - */ CCoeControl* ComponentControl( TInt aIndex ) const; /** * @see CCoeControl */ - void SizeChanged(); - - /** - * @see CCoeControl - */ void FocusChanged( TDrawNow aDrawNow ); /** @@ -82,15 +48,12 @@ private: CWmDrmDlaBrowserContainer( CAknView* aView ); - void ConstructL( MBrCtlSpecialLoadObserver* aObserver ); private: // data //Not owned CAknView* iView; - CBrCtlInterface* iBrCtlInterface; - }; #endif // C_WMDRMDLABROWSERCONTAINER_H diff -r 5ce76b969369 -r 2625ef7905cb wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowserview.h --- a/wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowserview.h Fri Aug 20 11:00:50 2010 +0300 +++ b/wmdrm/camese/wmdrmdlaapp/inc/wmdrmdlabrowserview.h Fri Aug 20 16:05:06 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -20,7 +20,6 @@ #define C_WMDRMDLABROWSERVIEW_H #include -#include class CWmDrmDlaBrowserContainer; class CInternetConnectionManager; @@ -36,8 +35,7 @@ }; -class CWmDrmDlaBrowserView : public CAknView, - public MBrCtlSpecialLoadObserver +class CWmDrmDlaBrowserView : public CAknView { public: @@ -50,33 +48,6 @@ */ virtual ~CWmDrmDlaBrowserView(); - /** - * Set the IAP that is used in network connection - * @param aIap - IAP to be used - */ - void SetIAP( TInt aIap ); - - /** - * Make a POST-request - * @param aCallback - Callback used to inform when license - * response is received - * @param aPostUrl - Post URL - * @param aPostContentType - Post content type - * @param aPostData - Post data - * @param aPostContentBoundary - Post content boundary - */ - void PostL( MBrowserViewLicenseReceivedCallback* aCallback, - const TDesC& aPostUrl, - const TDesC8& aPostContentType, - const TDesC8& aPostData, - const TDesC8& aPostContentBoundary ); - - /** - * Get the license response - * @return License response or NULL - */ - HBufC8* LicenseResponse(); - public: // From CAknView /** @@ -87,11 +58,6 @@ /** * @see CAknView */ - void HandleCommandL( TInt aCommand ); - - /** - * @see CAknView - */ void DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage ); @@ -107,17 +73,6 @@ public: // From MBrCtlSpecialLoadObserver - void NetworkConnectionNeededL( TInt* aConnectionPtr, - TInt* aSockSvrHandle, - TBool* aNewConn, - TApBearerType* aBearerType ); - - TBool HandleRequestL( RArray* aTypeArray, - CDesCArrayFlat* aDesArray ); - - TBool HandleDownloadL( RArray* aTypeArray, - CDesCArrayFlat* aDesArray ); - private: CWmDrmDlaBrowserView(); diff -r 5ce76b969369 -r 2625ef7905cb wmdrm/camese/wmdrmdlaapp/src/wmdrmdlaappservicesession.cpp --- a/wmdrm/camese/wmdrmdlaapp/src/wmdrmdlaappservicesession.cpp Fri Aug 20 11:00:50 2010 +0300 +++ b/wmdrm/camese/wmdrmdlaapp/src/wmdrmdlaappservicesession.cpp Fri Aug 20 16:05:06 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -121,8 +121,6 @@ } aMessage.ReadL( 0, iapPckg ); - BrowserView()->SetIAP( iap ); - CompleteMessage( aMessage, KErrNone ); } @@ -159,12 +157,6 @@ ptr8.Set( postContentBoundary->Des() ); aMessage.ReadL( 3, ptr8 ); - BrowserView()->PostL( this, - *postUrl, - *postContentType, - *postData, - *postContentBoundary ); - CleanupStack::PopAndDestroy( 4, postUrl ); //postContentBoundary, postData, //postContentType, postUrl @@ -187,16 +179,7 @@ { TInt err( KErrNone ); - HBufC8* licenseResponse( BrowserView()->LicenseResponse() ); - if ( licenseResponse ) - { - TInt licenseSize( licenseResponse->Size() ); - aMessage.WriteL( 0, TPckg( licenseSize ) ); - } - else - { err = KErrArgument; - } CompleteMessage( aMessage, err ); } @@ -209,16 +192,8 @@ { TInt err( KErrNone ); - HBufC8* licenseResponse( BrowserView()->LicenseResponse() ); - if ( licenseResponse ) - { - aMessage.WriteL( 0, *licenseResponse ); - } - else - { err = KErrArgument; - } - + CompleteMessage( aMessage, err ); } diff -r 5ce76b969369 -r 2625ef7905cb wmdrm/camese/wmdrmdlaapp/src/wmdrmdlabrowsercontainer.cpp --- a/wmdrm/camese/wmdrmdlaapp/src/wmdrmdlabrowsercontainer.cpp Fri Aug 20 11:00:50 2010 +0300 +++ b/wmdrm/camese/wmdrmdlaapp/src/wmdrmdlabrowsercontainer.cpp Fri Aug 20 16:05:06 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -19,49 +19,12 @@ // INCLUDE FILES #include #include -#include #include "wmdrmdlabrowserview.h" #include "wmdrmdlabrowsercontainer.h" // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::ConstructL -// --------------------------------------------------------------------------- -// -void CWmDrmDlaBrowserContainer::ConstructL( - MBrCtlSpecialLoadObserver* aObserver ) - { - CreateWindowL(); - SetRect( iView->ClientRect() ); - - iBrCtlInterface = CreateBrowserControlL( - this, // parent control - iView->ClientRect(), // client rect - TBrCtlDefs::ECapabilityLoadHttpFw | - TBrCtlDefs::ECapabilityDisplayScrollBar | - TBrCtlDefs::ECapabilityUseDlMgr | - TBrCtlDefs::ECapabilityCursorNavigation, // Capabilities - TBrCtlDefs::ECommandIdBase, // command base - NULL, // Softkeys observer - NULL, // LinkResolver - aObserver, // Special load observer - NULL, // Layout Observer - NULL, // Dialog provider - NULL, // window observer - NULL // Download observer - ); - - iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsAutoLoadImages, - ETrue ); - iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsCookiesEnabled, - ETrue ); - iBrCtlInterface->SetBrowserSettingL( TBrCtlDefs::ESettingsEmbedded, - ETrue ); - ActivateL(); - } - -// --------------------------------------------------------------------------- // CWmDrmDlaBrowserContainer::CWmDrmDlaBrowserContainer // --------------------------------------------------------------------------- // @@ -71,84 +34,6 @@ } // --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::NewL -// --------------------------------------------------------------------------- -// -CWmDrmDlaBrowserContainer* CWmDrmDlaBrowserContainer::NewL( - CAknView* aView, - MBrCtlSpecialLoadObserver* aObserver ) - { - CWmDrmDlaBrowserContainer* self - = CWmDrmDlaBrowserContainer::NewLC( aView, aObserver ); - CleanupStack::Pop( self ); - return self; - } - - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::NewLC -// --------------------------------------------------------------------------- -// -CWmDrmDlaBrowserContainer* CWmDrmDlaBrowserContainer::NewLC( - CAknView* aView, - MBrCtlSpecialLoadObserver* aObserver ) - { - CWmDrmDlaBrowserContainer* self - = new( ELeave ) CWmDrmDlaBrowserContainer( aView ); - CleanupStack::PushL( self ); - self->ConstructL( aObserver ); - return self; - } - - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::~CWmDrmDlaBrowserContainer -// --------------------------------------------------------------------------- -// -CWmDrmDlaBrowserContainer::~CWmDrmDlaBrowserContainer() - { - if(iBrCtlInterface != NULL) - { - TRAP_IGNORE( iBrCtlInterface->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelFetch + (TInt)TBrCtlDefs::ECommandIdBase )); - } - delete iBrCtlInterface; - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::BrCtlInterface -// --------------------------------------------------------------------------- -// -CBrCtlInterface* CWmDrmDlaBrowserContainer::BrCtlInterface() - { - return iBrCtlInterface; - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::CountComponentControls -// --------------------------------------------------------------------------- -// -TInt CWmDrmDlaBrowserContainer::CountComponentControls() const - { - if ( iBrCtlInterface ) - { - return 1; - } - return 0; - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::SizeChanged -// --------------------------------------------------------------------------- -// -void CWmDrmDlaBrowserContainer::SizeChanged() - { - if ( iBrCtlInterface ) - { - iBrCtlInterface->SetRect( Rect() ); - } - } - -// --------------------------------------------------------------------------- // CWmDrmDlaBrowserContainer::ComponentControl // --------------------------------------------------------------------------- // @@ -157,37 +42,18 @@ { switch ( aIndex ) { - case 0: - return iBrCtlInterface; - default: return NULL; } } // --------------------------------------------------------------------------- -// CWmDrmDlaBrowserContainer::OfferKeyEventL -// --------------------------------------------------------------------------- -// -TKeyResponse CWmDrmDlaBrowserContainer::OfferKeyEventL( - const TKeyEvent& aKeyEvent, - TEventCode aType ) - { - if ( iBrCtlInterface ) - { - return iBrCtlInterface->OfferKeyEventL( aKeyEvent, aType ); - } - return EKeyWasNotConsumed; - } - -// --------------------------------------------------------------------------- // CWmDrmDlaBrowserContainer::FocusChanged // --------------------------------------------------------------------------- // void CWmDrmDlaBrowserContainer::FocusChanged( TDrawNow aDrawNow ) { - iBrCtlInterface->SetFocus( IsFocused() ); CCoeControl::FocusChanged( aDrawNow ); } @@ -198,10 +64,6 @@ void CWmDrmDlaBrowserContainer::HandleResourceChange( TInt aType ) { - if ( iBrCtlInterface ) - { - iBrCtlInterface->HandleResourceChange( aType ); - } CCoeControl::HandleResourceChange( aType ); if ( aType == KEikDynamicLayoutVariantSwitch ) { diff -r 5ce76b969369 -r 2625ef7905cb wmdrm/camese/wmdrmdlaapp/src/wmdrmdlabrowserview.cpp --- a/wmdrm/camese/wmdrmdlaapp/src/wmdrmdlabrowserview.cpp Fri Aug 20 11:00:50 2010 +0300 +++ b/wmdrm/camese/wmdrmdlaapp/src/wmdrmdlabrowserview.cpp Fri Aug 20 16:05:06 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include "wmdrmdlabrowserview.h" @@ -30,7 +29,6 @@ #include "wmdrmdlaappconstants.h" // CONTANTS -_LIT( KDataTypeLicenseResponse, "application/vnd.ms-wmdrm.lic-resp" ); // ======== LOCAL FUNCTIONS ======== @@ -91,46 +89,6 @@ } // --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::SetIAP -// --------------------------------------------------------------------------- -// - -void CWmDrmDlaBrowserView::SetIAP( TInt aIap ) - { - iIap = aIap; - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::PostL -// --------------------------------------------------------------------------- -// -void CWmDrmDlaBrowserView::PostL( - MBrowserViewLicenseReceivedCallback* aCallback, - const TDesC& aPostUrl, - const TDesC8& aPostContentType, - const TDesC8& aPostData, - const TDesC8& aPostContentBoundary ) - { - iCallback = aCallback; - iContainer->BrCtlInterface()->PostUrlL( aPostUrl, - aPostContentType, - aPostData, - &aPostContentBoundary, - (TAny*)iContainer ); - iContainer->BrCtlInterface()->SetFocus( ETrue, EDrawNow ); - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::LicenseResponse -// --------------------------------------------------------------------------- -// - -HBufC8* CWmDrmDlaBrowserView::LicenseResponse() - { - return iLicenseResponse; - } - -// --------------------------------------------------------------------------- // CWmDrmDlaBrowserView::Id // --------------------------------------------------------------------------- // @@ -140,28 +98,6 @@ } // --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::HandleCommandL -// --------------------------------------------------------------------------- -// -void CWmDrmDlaBrowserView::HandleCommandL( - TInt aCommand ) - { - if ( aCommand >= TBrCtlDefs::ECommandIdBase + - TBrCtlDefs::ECommandIdWMLBase && - aCommand <= TBrCtlDefs::ECommandIdBase + - TBrCtlDefs::ECommandIdRange ) - { - BrCtlHandleCommandL( aCommand ); - } - else - { - iContainer->BrCtlInterface()->HandleCommandL( (TInt)TBrCtlDefs::ECommandCancelFetch + - (TInt)TBrCtlDefs::ECommandIdBase ); - AppUi()->HandleCommandL( aCommand ); - } - } - -// --------------------------------------------------------------------------- // CWmDrmDlaBrowserView::DoActivateL // --------------------------------------------------------------------------- // @@ -203,8 +139,6 @@ void CWmDrmDlaBrowserView::CreateContainerL() { RemoveContainer(); - iContainer = CWmDrmDlaBrowserContainer::NewL( this, this ); - iContainer->SetMopParent( this ); } // --------------------------------------------------------------------------- @@ -220,105 +154,3 @@ iContainer = NULL; } } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::BrCtlHandleCommandL -// --------------------------------------------------------------------------- -// -void CWmDrmDlaBrowserView::BrCtlHandleCommandL( TInt aCommand ) - { - iContainer->BrCtlInterface()->HandleCommandL( aCommand ); - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::NetworkConnectionNeededL -// --------------------------------------------------------------------------- -// -void CWmDrmDlaBrowserView::NetworkConnectionNeededL( - TInt* aConnectionPtr, - TInt* aSockSvrHandle, - TBool* aNewConn, - TApBearerType* aBearerType ) - { - TInt ret( 0 ); - // If not connected, try to start a new connection - if ( !iConMgr->Connected() ) - { - iConMgr->SetRequestedAP( iIap ); - ret = iConMgr->StartConnectionL( ETrue ); - } - - // If connected, return needed info to framework - if ( !ret ) - { - *aConnectionPtr = reinterpret_cast(&iConMgr->Connection() ); - *aSockSvrHandle = iConMgr->SocketServer().Handle(); - *aNewConn = EFalse; - *aBearerType = EApBearerTypeAllBearers; - } - else - { - User::Leave( KErrCancel ); - } - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::HandleRequestL -// --------------------------------------------------------------------------- -// -TBool CWmDrmDlaBrowserView::HandleRequestL( - RArray* /*aTypeArray*/, - CDesCArrayFlat* /*aDesArray*/ ) - { - return EFalse; - } - -// --------------------------------------------------------------------------- -// CWmDrmDlaBrowserView::HandleDownloadL -// --------------------------------------------------------------------------- -// -TBool CWmDrmDlaBrowserView::HandleDownloadL( - RArray* aTypeArray, - CDesCArrayFlat* aDesArray ) - { - //Check that content type and local file name exists - //There must be both, because download manager downloads POST-content - //in advance calling this function - TInt contentTypeIndex( aTypeArray->Find( EParamReceivedContentType ) ); - TInt fileNameIndex( aTypeArray->Find( EParamLocalFileName ) ); - if ( contentTypeIndex != KErrNotFound && - fileNameIndex != KErrNotFound && - contentTypeIndex < aDesArray->Count() && - fileNameIndex < aDesArray->Count() ) - { - //Check that the downloaded content is license response - TPtrC16 dataTypePtr( (*aDesArray)[contentTypeIndex] ); - if ( dataTypePtr.CompareF( KDataTypeLicenseResponse ) == 0 ) - { - //Get the path to the license response, - //read the response, delete the file and - //make a license received - callback - TPtrC16 filePathPtr( (*aDesArray)[fileNameIndex] ); - RFs fs; - User::LeaveIfError( fs.Connect() ); - CleanupClosePushL( fs ); - RFile file; - TInt size( 0 ); - User::LeaveIfError( file.Open( fs, filePathPtr, EFileRead ) ); - CleanupClosePushL( file ); - User::LeaveIfError( file.Size( size ) ); - delete iLicenseResponse; - iLicenseResponse = NULL; - iLicenseResponse = HBufC8::NewL( size ); - TPtr8 licensePtr( iLicenseResponse->Des() ); - User::LeaveIfError( file.Read( 0, licensePtr, size ) ); - CleanupStack::PopAndDestroy( &file ); - User::LeaveIfError( fs.Delete( filePathPtr ) ); - CleanupStack::PopAndDestroy( &fs ); - iCallback->LicenseReceived(); - return ETrue; - } - } - return EFalse; - } -