Index: Source/core/html/LinkResource.h |
diff --git a/Source/core/html/ime/InputMethodContext.h b/Source/core/html/LinkResource.h |
similarity index 63% |
copy from Source/core/html/ime/InputMethodContext.h |
copy to Source/core/html/LinkResource.h |
index 4315ea86e45649c521952c3a7a4c71db57c44f07..aa3afd32b12e83dbfdff7232e542b0f0f16b1346 100644 |
--- a/Source/core/html/ime/InputMethodContext.h |
+++ b/Source/core/html/LinkResource.h |
@@ -28,44 +28,52 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef InputMethodContext_h |
-#define InputMethodContext_h |
+#ifndef LinkResource_h |
+#define LinkResource_h |
-#include "bindings/v8/ScriptWrappable.h" |
-#include "core/html/HTMLElement.h" |
-#include "wtf/PassOwnPtr.h" |
-#include "wtf/RefPtr.h" |
+#include "core/loader/cache/CachedResourceRequest.h" |
+#include "core/platform/KURL.h" |
+#include "wtf/Forward.h" |
+#include "wtf/RefCounted.h" |
#include "wtf/text/WTFString.h" |
namespace WebCore { |
-class Composition; |
-class Node; |
+class HTMLLinkElement; |
-class InputMethodContext : public ScriptWrappable { |
+class LinkResource : public RefCounted<LinkResource> { |
public: |
- static PassOwnPtr<InputMethodContext> create(HTMLElement*); |
- ~InputMethodContext(); |
+ enum Type { |
+ Style, |
+ Import |
+ }; |
- void ref() { m_element->ref(); } |
- void deref() { m_element->deref(); } |
+ explicit LinkResource(HTMLLinkElement*); |
+ virtual ~LinkResource(); |
- Composition* composition() const; |
- bool enabled() const; |
- void setEnabled(bool); |
- String locale() const; |
- void confirmComposition(); |
- void setCaretRectangle(Node* anchor, int x, int y, int w, int h); |
- void setExclusionRectangle(Node* anchor, int x, int y, int w, int h); |
- bool open(); |
+ virtual Type type() const = 0; |
+ virtual void process() = 0; |
+ virtual void ownerRemoved() = 0; |
+ |
+protected: |
+ HTMLLinkElement* m_owner; |
+}; |
+ |
+class LinkRequestBuilder { |
+public: |
+ explicit LinkRequestBuilder(HTMLLinkElement* owner); |
+ |
+ bool isValid() const { return !m_url.isEmpty() && m_url.isValid(); } |
+ const KURL& url() const { return m_url; } |
+ const String& charset() const { return m_charset; } |
+ CachedResourceRequest build(bool blocking) const; |
private: |
- InputMethodContext(HTMLElement*); |
- bool m_enabled; |
- RefPtr<Composition> m_composition; |
- HTMLElement* m_element; |
+ HTMLLinkElement* m_owner; |
+ KURL m_url; |
+ String m_charset; |
}; |
} // namespace WebCore |
-#endif // InputMethodContext_h |
+#endif // LinkResource_h |