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 | #import <UIKit/UIKit.h> |
michael@0 | 2 | #include "SkCanvas.h" |
michael@0 | 3 | #include "SkGraphics.h" |
michael@0 | 4 | #import "SkEventNotifier.h" |
michael@0 | 5 | #include "SkOSMenu.h" |
michael@0 | 6 | #include "SkTime.h" |
michael@0 | 7 | #include "SkTypes.h" |
michael@0 | 8 | #import "SkUIView.h" |
michael@0 | 9 | #include "SkWindow.h" |
michael@0 | 10 | |
michael@0 | 11 | #define kINVAL_UIVIEW_EventType "inval-uiview" |
michael@0 | 12 | |
michael@0 | 13 | SkOSWindow::SkOSWindow(void* hWnd) : fHWND(hWnd) { |
michael@0 | 14 | fInvalEventIsPending = false; |
michael@0 | 15 | fNotifier = [[SkEventNotifier alloc] init]; |
michael@0 | 16 | } |
michael@0 | 17 | SkOSWindow::~SkOSWindow() { |
michael@0 | 18 | [(SkEventNotifier*)fNotifier release]; |
michael@0 | 19 | } |
michael@0 | 20 | |
michael@0 | 21 | void SkOSWindow::onHandleInval(const SkIRect& r) { |
michael@0 | 22 | if (!fInvalEventIsPending) { |
michael@0 | 23 | fInvalEventIsPending = true; |
michael@0 | 24 | (new SkEvent(kINVAL_UIVIEW_EventType, this->getSinkID()))->post(); |
michael@0 | 25 | } |
michael@0 | 26 | } |
michael@0 | 27 | |
michael@0 | 28 | bool SkOSWindow::onEvent(const SkEvent& evt) { |
michael@0 | 29 | if (evt.isType(kINVAL_UIVIEW_EventType)) { |
michael@0 | 30 | fInvalEventIsPending = false; |
michael@0 | 31 | const SkIRect& r = this->getDirtyBounds(); |
michael@0 | 32 | [(SkUIView*)fHWND postInvalWithRect:&r]; |
michael@0 | 33 | return true; |
michael@0 | 34 | } |
michael@0 | 35 | if ([(SkUIView*)fHWND onHandleEvent:evt]) { |
michael@0 | 36 | return true; |
michael@0 | 37 | } |
michael@0 | 38 | return this->INHERITED::onEvent(evt); |
michael@0 | 39 | } |
michael@0 | 40 | |
michael@0 | 41 | void SkOSWindow::onSetTitle(const char title[]) { |
michael@0 | 42 | [(SkUIView*)fHWND setSkTitle:title]; |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | void SkOSWindow::onAddMenu(const SkOSMenu* menu) { |
michael@0 | 46 | [(SkUIView*)fHWND onAddMenu:menu]; |
michael@0 | 47 | } |
michael@0 | 48 | |
michael@0 | 49 | void SkOSWindow::onUpdateMenu(SkOSMenu* menu) { |
michael@0 | 50 | [(SkUIView*)fHWND onUpdateMenu:menu]; |
michael@0 | 51 | } |
michael@0 | 52 | |
michael@0 | 53 | bool SkOSWindow::attach(SkBackEndTypes /* attachType */, |
michael@0 | 54 | int /* msaaSampleCount */, |
michael@0 | 55 | AttachmentInfo* info) { |
michael@0 | 56 | [(SkUIView*)fHWND getAttachmentInfo:info]; |
michael@0 | 57 | bool success = true; |
michael@0 | 58 | return success; |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | void SkOSWindow::detach() {} |
michael@0 | 62 | |
michael@0 | 63 | void SkOSWindow::present() { |
michael@0 | 64 | } |