gfx/skia/trunk/src/animator/SkDisplayEvent.h

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
-rw-r--r--

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.

     2 /*
     3  * Copyright 2006 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkDisplayEvent_DEFINED
    11 #define SkDisplayEvent_DEFINED
    13 #include "SkDisplayable.h"
    14 #include "SkMemberInfo.h"
    15 #include "SkIntArray.h"
    16 #include "SkKey.h"
    18 class SkEvent;
    20 class SkDisplayEvent : public SkDisplayable {
    21     DECLARE_DISPLAY_MEMBER_INFO(Event);
    22     enum Kind {
    23         kNo_kind,
    24         kKeyChar,
    25         kKeyPress,
    26         kKeyPressUp,    //i assume the order here is intended to match with skanimatorscript.cpp
    27         kMouseDown,
    28         kMouseDrag,
    29         kMouseMove,
    30         kMouseUp,
    31         kOnEnd,
    32         kOnload,
    33         kUser
    34     };
    35     SkDisplayEvent();
    36     virtual ~SkDisplayEvent();
    37     virtual bool addChild(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
    38     virtual bool contains(SkDisplayable*);
    39     virtual SkDisplayable* contains(const SkString& );
    40 #ifdef SK_DEBUG
    41     void dumpEvent(SkAnimateMaker* );
    42 #endif
    43     bool enableEvent(SkAnimateMaker& );
    44     virtual bool getProperty(int index, SkScriptValue* ) const;
    45     virtual void onEndElement(SkAnimateMaker& maker);
    46     void populateInput(SkAnimateMaker& , const SkEvent& fEvent);
    47     virtual bool setProperty(int index, SkScriptValue& );
    48 protected:
    49     SkKey code;
    50     SkBool disable;
    51     Kind kind;
    52     SkString target;
    53     SkScalar x;
    54     SkScalar y;
    55     SkTDDisplayableArray fChildren;
    56     mutable SkString fKeyString;
    57     SkKey fLastCode; // last key to trigger this event
    58     SkKey fMax; // if the code expresses a range
    59     SkDisplayable* fTarget; // used by onEnd
    60 private:
    61     void deleteMembers();
    62     friend class SkEvents;
    63     typedef SkDisplayable INHERITED;
    64 };
    66 #endif // SkDisplayEvent_DEFINED

mercurial