webengine/device/src/DeviceLiwBinding.cpp
changeset 11 c8a366e56285
parent 10 a359256acfc6
child 25 0ed94ceaa377
equal deleted inserted replaced
10:a359256acfc6 11:c8a366e56285
   121         m_scriptSession = m_secMgr->GetScriptSessionL( aPolicyId, *trust );
   121         m_scriptSession = m_secMgr->GetScriptSessionL( aPolicyId, *trust );
   122         if ( !m_scriptSession )
   122         if ( !m_scriptSession )
   123             {
   123             {
   124             User::Leave( KErrGeneral );
   124             User::Leave( KErrGeneral );
   125             }
   125             }
   126 #ifdef SECURITYMANAGER_PROMPT_ENHANCEMENT
   126 #ifdef BRDO_SEC_MGR_PROMPT_ENHANCEMENT_FF
   127 		m_scriptSession->SetPromptOption(RTPROMPTUI_PROVIDER);   //  This is for setting the new prompting method
   127 		m_scriptSession->SetPromptOption(RTPROMPTUI_PROVIDER);   //  This is for setting the new prompting method
   128 #endif
   128 #endif
   129         CleanupStack::PopAndDestroy( trust );
   129         CleanupStack::PopAndDestroy( trust );
   130     }
   130     }
   131 
   131 
   901             TLiwVariant v;
   901             TLiwVariant v;
   902             List jsList;
   902             List jsList;
   903             jsList.append( jsNumber( variant.AsMap()->Count() ) );
   903             jsList.append( jsNumber( variant.AsMap()->Count() ) );
   904             JSObject * rval = new DeviceLiwMap(exec->lexicalInterpreter()->builtinArray()->construct(
   904             JSObject * rval = new DeviceLiwMap(exec->lexicalInterpreter()->builtinArray()->construct(
   905                 exec, jsList ), variant.AsMap(), this);
   905                 exec, jsList ), variant.AsMap(), this);
   906             
   906 
   907             DevicePrivateBase* pMapData = (static_cast<DeviceLiwMap*> (rval))->getMapData();
   907             DevicePrivateBase* pMapData = (static_cast<DeviceLiwMap*> (rval))->getMapData();
   908             
   908 
   909             for ( TInt i = 0; i < variant.AsMap()->Count(); i++ )
   909             for ( TInt i = 0; i < variant.AsMap()->Count(); i++ )
   910                 {
   910                 {
   911                 TBuf8<KMaxKeySize> name;
   911                 TBuf8<KMaxKeySize> name;
   912                 TRAPD( error,
   912                 TRAPD( error,
   913                     {
   913                     {
   922                             {
   922                             {
   923                             DeviceLiwIterable* itObj = static_cast<DeviceLiwIterable*> (jsval);
   923                             DeviceLiwIterable* itObj = static_cast<DeviceLiwIterable*> (jsval);
   924                             DevicePrivateBase* itData = itObj->getIterableData();
   924                             DevicePrivateBase* itData = itObj->getIterableData();
   925                             itData->SetParent( pMapData );
   925                             itData->SetParent( pMapData );
   926                             pMapData->AddChild( itData );
   926                             pMapData->AddChild( itData );
   927                             }                   
   927                             }
   928                         else if ( v.TypeId() == EVariantTypeMap )    
   928                         else if ( v.TypeId() == EVariantTypeMap )
   929                             {
   929                             {
   930                             DeviceLiwMap* mapObj = static_cast<DeviceLiwMap*> (jsval);
   930                             DeviceLiwMap* mapObj = static_cast<DeviceLiwMap*> (jsval);
   931                             DevicePrivateBase* mapData = mapObj->getMapData();
   931                             DevicePrivateBase* mapData = mapObj->getMapData();
   932                             mapData->SetParent( pMapData ); 
   932                             mapData->SetParent( pMapData );
   933                             pMapData->AddChild( mapData );
   933                             pMapData->AddChild( mapData );
   934                             }
   934                             }
   935                         }
   935                         }
   936                     });
   936                     });
   937                 // No error processing
   937                 // No error processing
  1087 
  1087 
  1088     for ( TInt i = 0; i < aLiwList->Count(); i++ )
  1088     for ( TInt i = 0; i < aLiwList->Count(); i++ )
  1089         {
  1089         {
  1090         TBuf8<KMaxKeySize> name( (*aLiwList)[i].Name() );
  1090         TBuf8<KMaxKeySize> name( (*aLiwList)[i].Name() );
  1091         JSValue* jsval = LiwVariant2JsVal( exec, (*aLiwList)[i].Value() );
  1091         JSValue* jsval = LiwVariant2JsVal( exec, (*aLiwList)[i].Value() );
  1092         // connect DeviceLiwResult to DeviceLiwIterable  
  1092         // connect DeviceLiwResult to DeviceLiwIterable
  1093         if ( managed )
  1093         if ( managed )
  1094             { 
  1094             {
  1095             if ( (*aLiwList)[i].Value().TypeId() == EVariantTypeIterable )
  1095             if ( (*aLiwList)[i].Value().TypeId() == EVariantTypeIterable )
  1096                 {
  1096                 {
  1097                 DeviceLiwIterable* itObj = static_cast<DeviceLiwIterable*> (jsval);
  1097                 DeviceLiwIterable* itObj = static_cast<DeviceLiwIterable*> (jsval);
  1098                 DevicePrivateBase* itData = itObj->getIterableData();
  1098                 DevicePrivateBase* itData = itObj->getIterableData();
  1099                 itData->SetParent( retData ); 
  1099                 itData->SetParent( retData );
  1100                 retData->AddChild( itData );
  1100                 retData->AddChild( itData );
  1101                 }
  1101                 }
  1102             else if ( (*aLiwList)[i].Value().TypeId() == EVariantTypeMap )
  1102             else if ( (*aLiwList)[i].Value().TypeId() == EVariantTypeMap )
  1103                 {
  1103                 {
  1104                 DeviceLiwMap* mapObj = static_cast<DeviceLiwMap*> (jsval);
  1104                 DeviceLiwMap* mapObj = static_cast<DeviceLiwMap*> (jsval);
  1105                 DevicePrivateBase* mapData = mapObj->getMapData();
  1105                 DevicePrivateBase* mapData = mapObj->getMapData();
  1106                 mapData->SetParent( retData ); 
  1106                 mapData->SetParent( retData );
  1107                 retData->AddChild( mapData );
  1107                 retData->AddChild( mapData );
  1108                 }    
  1108                 }
  1109             }
  1109             }
  1110         rval->put( exec, Identifier( (const char*) name.PtrZ() ), jsval);  //??? should call AtL?
  1110         rval->put( exec, Identifier( (const char*) name.PtrZ() ), jsval);  //??? should call AtL?
  1111         }
  1111         }
  1112 
  1112 
  1113     return rval;
  1113     return rval;
  1121 // ----------------------------------------------------------------------------
  1121 // ----------------------------------------------------------------------------
  1122 //
  1122 //
  1123 void CDeviceLiwBinding::SetUid( const TUint& aValue)
  1123 void CDeviceLiwBinding::SetUid( const TUint& aValue)
  1124     {
  1124     {
  1125     m_Uid.iUid = aValue;
  1125     m_Uid.iUid = aValue;
  1126 #ifdef SECURITYMANAGER_PROMPT_ENHANCEMENT    
  1126 #ifdef BRDO_SEC_MGR_PROMPT_ENHANCEMENT_FF
  1127     SetAppName();
  1127     SetAppName();
  1128 #endif    
  1128 #endif
  1129     }
  1129     }
  1130 #ifdef SECURITYMANAGER_PROMPT_ENHANCEMENT
  1130 #ifdef BRDO_SEC_MGR_PROMPT_ENHANCEMENT_FF
  1131 // ----------------------------------------------------------------------------
  1131 // ----------------------------------------------------------------------------
  1132 // CDeviceLiwBinding::SetAppName
  1132 // CDeviceLiwBinding::SetAppName
  1133 // Sets the widget display name
  1133 // Sets the widget display name
  1134 //
  1134 //
  1135 // ----------------------------------------------------------------------------
  1135 // ----------------------------------------------------------------------------
  1145         }
  1145         }
  1146     else
  1146     else
  1147         {
  1147         {
  1148         User::Leave( ret );
  1148         User::Leave( ret );
  1149         }
  1149         }
  1150     
  1150 
  1151     CWidgetPropertyValue* displayname = widgetregistry.GetWidgetPropertyValueL(m_Uid, EBundleDisplayName );
  1151     CWidgetPropertyValue* displayname = widgetregistry.GetWidgetPropertyValueL(m_Uid, EBundleDisplayName );
  1152     User::LeaveIfError(widgetregistry.Disconnect());
  1152     User::LeaveIfError(widgetregistry.Disconnect());
  1153     CleanupStack::PopAndDestroy(); //widgetregistry
  1153     CleanupStack::PopAndDestroy(); //widgetregistry
  1154 
  1154 
  1155     if ( displayname && displayname->iType == EWidgetPropTypeString )
  1155     if ( displayname && displayname->iType == EWidgetPropTypeString )