gfx/skia/trunk/include/views/SkStackViewLayout.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 SkStackViewLayout_DEFINED
    11 #define SkStackViewLayout_DEFINED
    13 #include "SkView.h"
    15 class SkStackViewLayout : public SkView::Layout {
    16 public:
    17     SkStackViewLayout();
    19     enum Orient {
    20         kHorizontal_Orient,
    21         kVertical_Orient,
    23         kOrientCount
    24     };
    25     Orient  getOrient() const { return (Orient)fOrient; }
    26     void    setOrient(Orient);
    28     void        getMargin(SkRect*) const;
    29     void        setMargin(const SkRect&);
    31     SkScalar    getSpacer() const { return fSpacer; }
    32     void        setSpacer(SkScalar);
    34     /** Controls the posititioning in the same direction as the orientation
    35     */
    36     enum Pack {
    37         kStart_Pack,
    38         kCenter_Pack,
    39         kEnd_Pack,
    41         kPackCount
    42     };
    43     Pack    getPack() const { return (Pack)fPack; }
    44     void    setPack(Pack);
    46     /** Controls the posititioning at right angles to the orientation
    47     */
    48     enum Align {
    49         kStart_Align,
    50         kCenter_Align,
    51         kEnd_Align,
    52         kStretch_Align,
    54         kAlignCount
    55     };
    56     Align   getAlign() const { return (Align)fAlign; }
    57     void    setAlign(Align);
    59     bool    getRound() const { return SkToBool(fRound); }
    60     void    setRound(bool);
    62 protected:
    63     virtual void onLayoutChildren(SkView* parent);
    64     virtual void onInflate(const SkDOM&, const SkDOM::Node*);
    66 private:
    67     SkRect      fMargin;
    68     SkScalar    fSpacer;
    69     uint8_t     fOrient, fPack, fAlign, fRound;
    70 };
    72 class SkFillViewLayout : public SkView::Layout {
    73 public:
    74             SkFillViewLayout();
    75     void    getMargin(SkRect*) const;
    76     void    setMargin(const SkRect&);
    78 protected:
    79     // overrides;
    80     virtual void onLayoutChildren(SkView* parent);
    81     virtual void onInflate(const SkDOM& dom, const SkDOM::Node* node);
    83 private:
    84     SkRect  fMargin;
    85     typedef SkView::Layout INHERITED;
    86 };
    88 #endif

mercurial