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

Unified Diff: Source/core/html/LinkResource.h

Issue 15856002: First step of HTMLImports (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Mac build Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/html/LinkRelAttribute.cpp ('k') | Source/core/html/LinkResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/html/LinkRelAttribute.cpp ('k') | Source/core/html/LinkResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698