OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium 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 #include "pdf/instance.h" | 5 #include "pdf/instance.h" |
6 | 6 |
7 #include <algorithm> // for min() | 7 #include <algorithm> // for min() |
8 #define _USE_MATH_DEFINES // for M_PI | 8 #define _USE_MATH_DEFINES // for M_PI |
9 #include <cmath> // for log() and pow() | 9 #include <cmath> // for log() and pow() |
10 #include <math.h> | 10 #include <math.h> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 const uint32 kToolbarSplashTimeoutMs = 6000; | 64 const uint32 kToolbarSplashTimeoutMs = 6000; |
65 const uint32 kMessageTextColor = 0xFF575757; | 65 const uint32 kMessageTextColor = 0xFF575757; |
66 const uint32 kMessageTextSize = 22; | 66 const uint32 kMessageTextSize = 22; |
67 const uint32 kProgressFadeTimeoutMs = 250; | 67 const uint32 kProgressFadeTimeoutMs = 250; |
68 const uint32 kProgressDelayTimeoutMs = 1000; | 68 const uint32 kProgressDelayTimeoutMs = 1000; |
69 const uint32 kAutoScrollTimeoutMs = 50; | 69 const uint32 kAutoScrollTimeoutMs = 50; |
70 const double kAutoScrollFactor = 0.2; | 70 const double kAutoScrollFactor = 0.2; |
71 | 71 |
72 // Javascript methods. | 72 // Javascript methods. |
73 const char* kJSAccessibility = "accessibility"; | 73 const char kJSAccessibility[] = "accessibility"; |
74 const char* kJSDocumentLoadComplete = "documentLoadComplete"; | 74 const char kJSDocumentLoadComplete[] = "documentLoadComplete"; |
75 const char* kJSGetHeight = "getHeight"; | 75 const char kJSGetHeight[] = "getHeight"; |
76 const char* kJSGetHorizontalScrollbarThickness = | 76 const char kJSGetHorizontalScrollbarThickness[] = |
77 "getHorizontalScrollbarThickness"; | 77 "getHorizontalScrollbarThickness"; |
78 const char* kJSGetPageLocationNormalized = "getPageLocationNormalized"; | 78 const char kJSGetPageLocationNormalized[] = "getPageLocationNormalized"; |
79 const char* kJSGetVerticalScrollbarThickness = "getVerticalScrollbarThickness"; | 79 const char kJSGetVerticalScrollbarThickness[] = "getVerticalScrollbarThickness"; |
80 const char* kJSGetWidth = "getWidth"; | 80 const char kJSGetWidth[] = "getWidth"; |
81 const char* kJSGetZoomLevel = "getZoomLevel"; | 81 const char kJSGetZoomLevel[] = "getZoomLevel"; |
82 const char* kJSGoToPage = "goToPage"; | 82 const char kJSGoToPage[] = "goToPage"; |
83 const char* kJSGrayscale = "grayscale"; | 83 const char kJSGrayscale[] = "grayscale"; |
84 const char* kJSLoadPreviewPage = "loadPreviewPage"; | 84 const char kJSLoadPreviewPage[] = "loadPreviewPage"; |
85 const char* kJSOnLoad = "onload"; | 85 const char kJSOnLoad[] = "onload"; |
86 const char* kJSOnPluginSizeChanged = "onPluginSizeChanged"; | 86 const char kJSOnPluginSizeChanged[] = "onPluginSizeChanged"; |
87 const char* kJSOnScroll = "onScroll"; | 87 const char kJSOnScroll[] = "onScroll"; |
88 const char* kJSPageXOffset = "pageXOffset"; | 88 const char kJSPageXOffset[] = "pageXOffset"; |
89 const char* kJSPageYOffset = "pageYOffset"; | 89 const char kJSPageYOffset[] = "pageYOffset"; |
90 const char* kJSPrintPreviewPageCount = "printPreviewPageCount"; | 90 const char kJSPrintPreviewPageCount[] = "printPreviewPageCount"; |
91 const char* kJSReload = "reload"; | 91 const char kJSReload[] = "reload"; |
92 const char* kJSRemovePrintButton = "removePrintButton"; | 92 const char kJSRemovePrintButton[] = "removePrintButton"; |
93 const char* kJSResetPrintPreviewUrl = "resetPrintPreviewUrl"; | 93 const char kJSResetPrintPreviewUrl[] = "resetPrintPreviewUrl"; |
94 const char* kJSSendKeyEvent = "sendKeyEvent"; | 94 const char kJSSendKeyEvent[] = "sendKeyEvent"; |
95 const char* kJSSetPageNumbers = "setPageNumbers"; | 95 const char kJSSetPageNumbers[] = "setPageNumbers"; |
96 const char* kJSSetPageXOffset = "setPageXOffset"; | 96 const char kJSSetPageXOffset[] = "setPageXOffset"; |
97 const char* kJSSetPageYOffset = "setPageYOffset"; | 97 const char kJSSetPageYOffset[] = "setPageYOffset"; |
98 const char* kJSSetZoomLevel = "setZoomLevel"; | 98 const char kJSSetZoomLevel[] = "setZoomLevel"; |
99 const char* kJSZoomFitToHeight = "fitToHeight"; | 99 const char kJSZoomFitToHeight[] = "fitToHeight"; |
100 const char* kJSZoomFitToWidth = "fitToWidth"; | 100 const char kJSZoomFitToWidth[] = "fitToWidth"; |
101 const char* kJSZoomIn = "zoomIn"; | 101 const char kJSZoomIn[] = "zoomIn"; |
102 const char* kJSZoomOut = "zoomOut"; | 102 const char kJSZoomOut[] = "zoomOut"; |
103 | 103 |
104 // URL reference parameters. | 104 // URL reference parameters. |
105 // For more possible parameters, see RFC 3778 and the "PDF Open Parameters" | 105 // For more possible parameters, see RFC 3778 and the "PDF Open Parameters" |
106 // document from Adobe. | 106 // document from Adobe. |
107 const char kDelimiters[] = "#&"; | 107 const char kDelimiters[] = "#&"; |
108 const char kNamedDest[] = "nameddest"; | 108 const char kNamedDest[] = "nameddest"; |
109 const char kPage[] = "page"; | 109 const char kPage[] = "page"; |
110 | 110 |
111 const char kChromePrint[] = "chrome://print/"; | 111 const char kChromePrint[] = "chrome://print/"; |
112 | 112 |
(...skipping 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2710 return instance_->HasScriptableMethod(name, exception); | 2710 return instance_->HasScriptableMethod(name, exception); |
2711 } | 2711 } |
2712 | 2712 |
2713 pp::Var PDFScriptableObject::Call(const pp::Var& method, | 2713 pp::Var PDFScriptableObject::Call(const pp::Var& method, |
2714 const std::vector<pp::Var>& args, | 2714 const std::vector<pp::Var>& args, |
2715 pp::Var* exception) { | 2715 pp::Var* exception) { |
2716 return instance_->CallScriptableMethod(method, args, exception); | 2716 return instance_->CallScriptableMethod(method, args, exception); |
2717 } | 2717 } |
2718 | 2718 |
2719 } // namespace chrome_pdf | 2719 } // namespace chrome_pdf |
OLD | NEW |