OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "app.h" | 7 #include "app.h" |
8 | 8 |
9 #include "Document.h" | 9 #include "Document.h" |
10 #include "JS_Context.h" | 10 #include "JS_Context.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 #endif // PDF_ENABLE_XFA | 211 #endif // PDF_ENABLE_XFA |
212 | 212 |
213 vp << JS_NUM_VIEWERVERSION; | 213 vp << JS_NUM_VIEWERVERSION; |
214 return TRUE; | 214 return TRUE; |
215 } | 215 } |
216 | 216 |
217 FX_BOOL app::platform(IJS_Context* cc, | 217 FX_BOOL app::platform(IJS_Context* cc, |
218 CJS_PropValue& vp, | 218 CJS_PropValue& vp, |
219 CFX_WideString& sError) { | 219 CFX_WideString& sError) { |
220 if (vp.IsGetting()) { | 220 if (!vp.IsGetting()) |
| 221 return FALSE; |
| 222 CPDFDoc_Environment* pEnv = |
| 223 static_cast<CJS_Context*>(cc)->GetJSRuntime()->GetReaderApp(); |
| 224 if (!pEnv) |
| 225 return FALSE; |
| 226 CFX_WideString platfrom = pEnv->FFI_GetPlatform(); |
| 227 if (platfrom.IsEmpty()) |
221 vp << JS_STR_PLATFORM; | 228 vp << JS_STR_PLATFORM; |
222 return TRUE; | 229 else |
223 } | 230 vp << platfrom; |
224 | 231 return TRUE; |
225 return FALSE; | |
226 } | 232 } |
227 | 233 |
228 FX_BOOL app::language(IJS_Context* cc, | 234 FX_BOOL app::language(IJS_Context* cc, |
229 CJS_PropValue& vp, | 235 CJS_PropValue& vp, |
230 CFX_WideString& sError) { | 236 CFX_WideString& sError) { |
231 if (vp.IsGetting()) { | 237 if (vp.IsGetting()) { |
232 vp << JS_STR_LANGUANGE; | 238 vp << JS_STR_LANGUANGE; |
233 return TRUE; | 239 return TRUE; |
234 } | 240 } |
235 | 241 |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { | 820 FX_BOOL app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { |
815 return FALSE; | 821 return FALSE; |
816 } | 822 } |
817 | 823 |
818 FX_BOOL app::execDialog(IJS_Context* cc, | 824 FX_BOOL app::execDialog(IJS_Context* cc, |
819 const std::vector<CJS_Value>& params, | 825 const std::vector<CJS_Value>& params, |
820 CJS_Value& vRet, | 826 CJS_Value& vRet, |
821 CFX_WideString& sError) { | 827 CFX_WideString& sError) { |
822 return TRUE; | 828 return TRUE; |
823 } | 829 } |
OLD | NEW |