Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: sky/engine/core/css/CSSImageValue.h

Issue 1214633005: Remove CSS clients of ImageResource (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/css/CSSImageSetValue.cpp ('k') | sky/engine/core/css/CSSImageValue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21 #ifndef SKY_ENGINE_CORE_CSS_CSSIMAGEVALUE_H_
22 #define SKY_ENGINE_CORE_CSS_CSSIMAGEVALUE_H_
23
24 #include "sky/engine/core/css/CSSValue.h"
25 #include "sky/engine/core/fetch/ResourceFetcher.h"
26 #include "sky/engine/platform/weborigin/Referrer.h"
27 #include "sky/engine/wtf/RefPtr.h"
28
29 namespace blink {
30
31 class Document;
32 class Element;
33 class KURL;
34 class StyleFetchedImage;
35 class StyleImage;
36 class RenderObject;
37
38 class CSSImageValue : public CSSValue {
39 public:
40 static PassRefPtr<CSSImageValue> create(const KURL& url, StyleImage* image = 0)
41 {
42 return adoptRef(new CSSImageValue(url, url, image));
43 }
44 static PassRefPtr<CSSImageValue> create(const String& rawValue, const KURL& url, StyleImage* image = 0)
45 {
46 return adoptRef(new CSSImageValue(rawValue, url, image));
47 }
48 ~CSSImageValue();
49
50 StyleFetchedImage* cachedImage(ResourceFetcher*, const ResourceLoaderOptions &);
51 StyleFetchedImage* cachedImage(ResourceFetcher* fetcher) { return cachedImag e(fetcher, ResourceFetcher::defaultResourceOptions()); }
52 // Returns a StyleFetchedImage if the image is cached already, otherwise a S tylePendingImage.
53 StyleImage* cachedOrPendingImage();
54
55 const String& url() { return m_absoluteURL; }
56
57 void setReferrer(const Referrer& referrer) { m_referrer = referrer; }
58 const Referrer& referrer() const { return m_referrer; }
59
60 void reResolveURL(const Document&);
61
62 String customCSSText() const;
63
64 PassRefPtr<CSSValue> cloneForCSSOM() const;
65
66 bool equals(const CSSImageValue&) const;
67
68 bool knownToBeOpaque(const RenderObject*) const;
69
70 void setInitiator(const AtomicString& name) { m_initiatorName = name; }
71 void restoreCachedResourceIfNeeded(Document&);
72
73 private:
74 CSSImageValue(const String& rawValue, const KURL&, StyleImage*);
75
76 String m_relativeURL;
77 String m_absoluteURL;
78 Referrer m_referrer;
79 RefPtr<StyleImage> m_image;
80 bool m_accessedImage;
81 AtomicString m_initiatorName;
82 };
83
84 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageValue, isImageValue());
85
86 } // namespace blink
87
88 #endif // SKY_ENGINE_CORE_CSS_CSSIMAGEVALUE_H_
OLDNEW
« no previous file with comments | « sky/engine/core/css/CSSImageSetValue.cpp ('k') | sky/engine/core/css/CSSImageValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698