omadrm/drmengine/agentv2/src/Oma2AgentContent.cpp
branchRCL_3
changeset 27 1481bf457703
parent 26 1221b68b8a5f
equal deleted inserted replaced
26:1221b68b8a5f 27:1481bf457703
     1 /*
     1 /*
     2 * Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    23 #include <caf/bitset.h>
    23 #include <caf/bitset.h>
    24 #include <caf/attribute.h>
    24 #include <caf/attribute.h>
    25 #include <e32test.h>
    25 #include <e32test.h>
    26 #include <utf.h>
    26 #include <utf.h>
    27 
    27 
    28 #include <drmbrowserlauncher.h>
    28 
       
    29 #include <schemehandler.h>
       
    30 
    29 
    31 
    30 #include "Oma2AgentContent.h"
    32 #include "Oma2AgentContent.h"
    31 #include "Oma2AgentAttributes.h"
    33 #include "Oma2AgentAttributes.h"
    32 #include "Oma1Dcf.h"
    34 #include "Oma1Dcf.h"
    33 #include "oma2dcf.h"
    35 #include "oma2dcf.h"
   541         }
   543         }
   542     }
   544     }
   543 
   545 
   544 // -----------------------------------------------------------------------------
   546 // -----------------------------------------------------------------------------
   545 // COma2AgentContent::NotifyStatusChange
   547 // COma2AgentContent::NotifyStatusChange
       
   548 //
   546 // -----------------------------------------------------------------------------
   549 // -----------------------------------------------------------------------------
   547 //
   550 //
   548 void COma2AgentContent::NotifyStatusChange(
   551 void COma2AgentContent::NotifyStatusChange(
   549     TEventMask aEventMask,
   552     TEventMask aEventMask,
   550     TRequestStatus& aStatus,
   553     TRequestStatus& aStatus,
   601     const TDesC& aUniqueId)
   604     const TDesC& aUniqueId)
   602     {
   605     {
   603     TRequestStatus *ptr = &aStatus;
   606     TRequestStatus *ptr = &aStatus;
   604     TInt r;
   607     TInt r;
   605     HBufC* b = NULL;
   608     HBufC* b = NULL;
   606 
   609     CSchemeHandler* handler = NULL;
   607     r = KErrNotSupported;
       
   608 
   610 
   609     r = iDcf->OpenPart(aUniqueId);
   611     r = iDcf->OpenPart(aUniqueId);
   610     if (r == KErrNone && iDcf->iRightsIssuerURL != NULL)
   612     if (r == KErrNone && iDcf->iRightsIssuerURL != NULL)
   611         {
   613         {
   612         TRAP(r, b = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   614         TRAP(r, b = CnvUtfConverter::ConvertToUnicodeFromUtf8L(
   613             *iDcf->iRightsIssuerURL));
   615             *iDcf->iRightsIssuerURL));
   614         if (b != NULL)
   616         if (b != NULL)
   615             {
   617             {
   616     				DRM::CDrmBrowserLauncher* browserLauncher = DRM::CDrmBrowserLauncher::NewLC();
   618             TRAP(r, handler = CSchemeHandler::NewL(*b));
   617     	
   619             if (handler != NULL)
   618 				    browserLauncher->LaunchUrlL(*b);
   620                 {
   619     
   621                 TRAP(r, handler->HandleUrlStandaloneL());
   620     				CleanupStack::PopAndDestroy(); // browserLauncher
   622                 delete handler;
   621    
   623                 }
   622             delete b;
   624             delete b;
   623             }
   625             }
   624         }
   626         }
   625 
   627     User::RequestComplete(ptr, r);
   626 		User::RequestComplete(ptr, r);
       
   627     }
   628     }
   628 
   629 
   629 // -----------------------------------------------------------------------------
   630 // -----------------------------------------------------------------------------
   630 // COma2AgentContent::CancelRequestRights
   631 // COma2AgentContent::CancelRequestRights
   631 // Not supported, getting rights is handled outside the scope of the agent and
   632 // Not supported, getting rights is handled outside the scope of the agent and