Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright 2013 Google Inc. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef SkPDFDeviceFlattener_DEFINED |
michael@0 | 9 | #define SkPDFDeviceFlattener_DEFINED |
michael@0 | 10 | |
michael@0 | 11 | #include "SkPDFDevice.h" |
michael@0 | 12 | |
michael@0 | 13 | |
michael@0 | 14 | /** \class SkPDFDeviceFlattener |
michael@0 | 15 | |
michael@0 | 16 | The PDF Device Flattener is used to flatten features without native support in PDF. |
michael@0 | 17 | For now, the only one implemented is Perspective. |
michael@0 | 18 | |
michael@0 | 19 | TODO(edisonn): Rename the class once we know all the things it will do. |
michael@0 | 20 | */ |
michael@0 | 21 | class SkPDFDeviceFlattener : public SkPDFDevice { |
michael@0 | 22 | private: |
michael@0 | 23 | typedef SkPDFDevice INHERITED; |
michael@0 | 24 | |
michael@0 | 25 | SK_API SkPDFDeviceFlattener(const SkSize& pageSize, const SkRect* trimBox = NULL); |
michael@0 | 26 | |
michael@0 | 27 | public: |
michael@0 | 28 | SK_API virtual ~SkPDFDeviceFlattener(); |
michael@0 | 29 | |
michael@0 | 30 | virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
michael@0 | 31 | size_t count, const SkPoint[], |
michael@0 | 32 | const SkPaint& paint) SK_OVERRIDE; |
michael@0 | 33 | virtual void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint); |
michael@0 | 34 | virtual void drawPath(const SkDraw&, const SkPath& origpath, |
michael@0 | 35 | const SkPaint& paint, const SkMatrix* prePathMatrix, |
michael@0 | 36 | bool pathIsMutable) SK_OVERRIDE; |
michael@0 | 37 | virtual void drawText(const SkDraw&, const void* text, size_t len, |
michael@0 | 38 | SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE; |
michael@0 | 39 | virtual void drawPosText(const SkDraw&, const void* text, size_t len, |
michael@0 | 40 | const SkScalar pos[], SkScalar constY, |
michael@0 | 41 | int scalarsPerPos, const SkPaint&) SK_OVERRIDE; |
michael@0 | 42 | virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |
michael@0 | 43 | const SkPath& path, const SkMatrix* matrix, |
michael@0 | 44 | const SkPaint& paint) SK_OVERRIDE; |
michael@0 | 45 | private: |
michael@0 | 46 | |
michael@0 | 47 | bool mustFlatten(const SkDraw& d) const; |
michael@0 | 48 | bool mustPathText(const SkDraw& d, const SkPaint& paint); |
michael@0 | 49 | |
michael@0 | 50 | friend class SkDocument_PDF; |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | #endif // SkPDFDeviceFlattener_DEFINED |