gfx/skia/trunk/src/views/ios/SkOSWindow_iOS.mm

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rwxr-xr-x

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.

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

mercurial