Index: third_party/WebKit/Source/modules/mime_handler_view/MimeHandlerView.h |
diff --git a/third_party/WebKit/Source/modules/mime_handler_view/MimeHandlerView.h b/third_party/WebKit/Source/modules/mime_handler_view/MimeHandlerView.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..06f13557ea01ebef38d15deabe629fdb3e210c97 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/mime_handler_view/MimeHandlerView.h |
@@ -0,0 +1,53 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MimeHanderView_h |
+#define MimeHanderView_h |
+ |
+#include "core/plugins/PluginClient.h" |
+#include "modules/ModulesExport.h" |
+#include "platform/heap/GarbageCollected.h" |
+#include "platform/heap/Persistent.h" |
+#include "public/platform/WebString.h" |
+#include "public/platform/WebURL.h" |
+#include "public/platform/modules/mime_handler_view/mime_handler_view.mojom-blink.h" |
+#include "public/web/WebAssociatedURLLoader.h" |
+ |
+namespace blink { |
+class HTMLPlugInElement; |
+class LocalFrame; |
+class WebString; |
+ |
+class MODULES_EXPORT MimeHandlerView final : public PluginClient { |
+ public: |
+ static MimeHandlerView* create(HTMLPlugInElement*, |
+ const WebURL&, |
+ const WebString&, |
+ int32_t); |
+ ~MimeHandlerView(); |
+ |
+ // Verifies that the MimeHandlerViewService exists and can handle the mime |
+ // type. |
+ bool initialize(); |
+ void close(); |
+ |
+ // PluginClient override. |
+ v8::Local<v8::Object> scriptableObject(v8::Isolate*) override; |
+ |
+ private: |
+ explicit MimeHandlerView(HTMLPlugInElement*, const WebURL&, const WebString&, int32_t); |
+ |
+ LocalFrame* embedderFrame(); |
+ void createWebUrlRequestForResource(); |
+ mojom::blink::MimeHandlerViewServicePtr mimeHandlerViewService(); |
+ void createMimeHandlerView(const WebString&); |
+ |
+ WebString m_mimeType; |
+ WebURL m_resourceUrl; |
+ int32_t m_elementInstanceId; |
+ std::unique_ptr<blink::WebAssociatedURLLoader> m_loader; |
+}; |
+} |
+ |
+#endif // MimeHanderView_h |