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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2103573002: Use const variable instead of using a macro to store a constant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 01aae84ae307949ebe96f200809b3d54f5aa3db0..7688a7dacda3fcdc30bdf5e68a4f5ee8bc2a1bf3 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -67,35 +67,35 @@ namespace chrome_pdf {
namespace {
-#define kPageShadowTop 3
-#define kPageShadowBottom 7
-#define kPageShadowLeft 5
-#define kPageShadowRight 5
+const int32_t kPageShadowTop = 3;
+const int32_t kPageShadowBottom = 7;
+const int32_t kPageShadowLeft = 5;
+const int32_t kPageShadowRight = 5;
-#define kPageSeparatorThickness 4
-#define kHighlightColorR 153
-#define kHighlightColorG 193
-#define kHighlightColorB 218
+const int32_t kPageSeparatorThickness = 4;
+const int32_t kHighlightColorR = 153;
+const int32_t kHighlightColorG = 193;
+const int32_t kHighlightColorB = 218;
const uint32_t kPendingPageColor = 0xFFEEEEEE;
-#define kFormHighlightColor 0xFFE4DD
-#define kFormHighlightAlpha 100
+const uint32_t kFormHighlightColor = 0xFFE4DD;
+const int32_t kFormHighlightAlpha = 100;
-#define kMaxPasswordTries 3
+const int32_t kMaxPasswordTries = 3;
// See Table 3.20 in
// http://www.adobe.com/devnet/acrobat/pdfs/pdf_reference_1-7.pdf
-#define kPDFPermissionPrintLowQualityMask 1 << 2
-#define kPDFPermissionPrintHighQualityMask 1 << 11
-#define kPDFPermissionCopyMask 1 << 4
-#define kPDFPermissionCopyAccessibleMask 1 << 9
+const uint32_t kPDFPermissionPrintLowQualityMask = 1 << 2;
+const uint32_t kPDFPermissionPrintHighQualityMask = 1 << 11;
+const uint32_t kPDFPermissionCopyMask = 1 << 4;
+const uint32_t kPDFPermissionCopyAccessibleMask = 1 << 9;
-#define kLoadingTextVerticalOffset 50
+const int32_t kLoadingTextVerticalOffset = 50;
// The maximum amount of time we'll spend doing a paint before we give back
// control of the thread.
-#define kMaxProgressivePaintTimeMs 300
+const int32_t kMaxProgressivePaintTimeMs = 300;
Lei Zhang 2016/06/27 21:28:07 This is a test comment.
jaepark 2016/06/27 21:31:36 Done.
// The maximum amount of time we'll spend doing the first paint. This is less
// than the above to keep things smooth if the user is scrolling quickly. This
@@ -108,7 +108,7 @@ const uint32_t kPendingPageColor = 0xFFEEEEEE;
// the final painting can start.
// The scrollbar will always be responsive since it is managed by a separate
// process.
-#define kMaxInitialProgressivePaintTimeMs 250
+const int32_t kMaxInitialProgressivePaintTimeMs = 250;
Lei Zhang 2016/06/27 21:28:07 This is another test comment.
jaepark 2016/06/27 21:31:36 This is a test reply.
std::vector<uint32_t> GetPageNumbersFromPrintPageNumberRange(
const PP_PrintPageNumberRange_Dev* page_ranges,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698