Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(967)

Unified Diff: fpdfsdk/src/javascript/app.cpp

Issue 1302423008: Merge to XFA: Beef up app_props.in and tidy app.cpp. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | testing/resources/javascript/app_props.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/app.cpp
diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp
index c8815a0ca171f0066fd375e10b8b823141aac48f..4815e4729c3745d61e1e368d8a35241f44f8cf8d 100644
--- a/fpdfsdk/src/javascript/app.cpp
+++ b/fpdfsdk/src/javascript/app.cpp
@@ -18,16 +18,10 @@
static v8::Isolate* GetIsolate(IFXJS_Context* cc) {
CJS_Context* pContext = (CJS_Context*)cc;
- ASSERT(pContext != NULL);
-
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
- ASSERT(pRuntime != NULL);
-
return pRuntime->GetIsolate();
}
-/* ---------------------------- TimerObj ---------------------------- */
-
BEGIN_JS_STATIC_CONST(CJS_TimerObj)
END_JS_STATIC_CONST()
@@ -52,19 +46,14 @@ CJS_Timer* TimerObj::GetTimer() const {
return m_pTimer;
}
-#define JS_STR_VIEWERTYPE_READER L"Reader"
-#define JS_STR_VIEWERTYPE_STANDARD L"Exchange"
+#define JS_STR_VIEWERTYPE L"pdfium"
#define JS_STR_VIEWERVARIATION L"Full"
#define JS_STR_PLATFORM L"WIN"
#define JS_STR_LANGUANGE L"ENU"
-#define JS_STR_VIEWERVERSION 8
-#define JS_STR_VIEWERVERSION_XFA 11
+#define JS_NUM_VIEWERVERSION 8
+#define JS_NUM_VIEWERVERSION_XFA 11
#define JS_NUM_FORMSVERSION 7
-#define JS_FILEPATH_MAXLEN 2000
-
-/* ---------------------------- app ---------------------------- */
-
BEGIN_JS_STATIC_CONST(CJS_App)
END_JS_STATIC_CONST()
@@ -188,7 +177,7 @@ FX_BOOL app::viewerType(IFXJS_Context* cc,
CJS_PropValue& vp,
CFX_WideString& sError) {
if (vp.IsGetting()) {
- vp << L"pdfium";
+ vp << JS_STR_VIEWERTYPE;
return TRUE;
}
@@ -216,9 +205,9 @@ FX_BOOL app::viewerVersion(IFXJS_Context* cc,
CPDFSDK_Document* pCurDoc = pContext->GetReaderDocument();
CPDFXFA_Document* pDoc = pCurDoc->GetDocument();
if (pDoc->GetDocType() == 1 || pDoc->GetDocType() == 2)
- vp << JS_STR_VIEWERVERSION_XFA;
+ vp << JS_NUM_VIEWERVERSION_XFA;
else
- vp << JS_STR_VIEWERVERSION;
+ vp << JS_NUM_VIEWERVERSION;
return TRUE;
}
« no previous file with comments | « no previous file | testing/resources/javascript/app_props.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698