1231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block/*
2231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * Copyright (C) 2009 Apple Inc. All rights reserved.
3231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *
4231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * Redistribution and use in source and binary forms, with or without
5231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * modification, are permitted provided that the following conditions
6231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * are met:
7231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * 1. Redistributions of source code must retain the above copyright
8231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *    notice, this list of conditions and the following disclaimer.
9231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * 2. Redistributions in binary form must reproduce the above copyright
10231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *    notice, this list of conditions and the following disclaimer in the
11231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *    documentation and/or other materials provided with the distribution.
12231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block *
13231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block */
25231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
26231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#ifndef UserStyleSheet_h
27231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#define UserStyleSheet_h
28231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
29231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "KURL.h"
30e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke#include "UserContentTypes.h"
31231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include "UserStyleSheetTypes.h"
32231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include <wtf/OwnPtr.h>
33231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include <wtf/PassOwnPtr.h>
34231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#include <wtf/Vector.h>
35231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
36231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blocknamespace WebCore {
37231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
38ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdochclass UserStyleSheet {
39ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddbBen Murdoch    WTF_MAKE_NONCOPYABLE(UserStyleSheet); WTF_MAKE_FAST_ALLOCATED;
40231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockpublic:
41231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    UserStyleSheet(const String& source, const KURL& url,
42e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke                   PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
43bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen                   UserContentInjectedFrames injectedFrames, UserStyleLevel level)
44231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        : m_source(source)
45231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        , m_url(url)
46231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        , m_whitelist(whitelist)
47231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block        , m_blacklist(blacklist)
48e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke        , m_injectedFrames(injectedFrames)
49f486d19d62f1bc33246748b14b14a9dfa617b57fIain Merrick        , m_level(level)
50231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    {
51231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    }
52231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
53231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    const String& source() const { return m_source; }
54231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    const KURL& url() const { return m_url; }
55231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    const Vector<String>* whitelist() const { return m_whitelist.get(); }
56231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    const Vector<String>* blacklist() const { return m_blacklist.get(); }
57e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke    UserContentInjectedFrames injectedFrames() const { return m_injectedFrames; }
58bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    UserStyleLevel level() const { return m_level; }
59231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
60231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Blockprivate:
61231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    String m_source;
62231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    KURL m_url;
63231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    OwnPtr<Vector<String> > m_whitelist;
64231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block    OwnPtr<Vector<String> > m_blacklist;
65e458d70a0d18538346f41b503114c9ebe6b2ce12Leon Clarke    UserContentInjectedFrames m_injectedFrames;
66bec39347bb3bb5bf1187ccaf471d26247f28b585Kristian Monsen    UserStyleLevel m_level;
67231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block};
68231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
69231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block} // namespace WebCore
70231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block
71231d4e3152a9c27a73b6ac7badbe6be673aa3ddfSteve Block#endif // UserStyleSheet_h
72