1 /* 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * Copyright (C) 2014 Opera Software ASA. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 15 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 16 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 19 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27 #ifndef PluginView_h 28 #define PluginView_h 29 30 #include "platform/Widget.h" 31 #include "platform/scroll/ScrollTypes.h" 32 #include "wtf/text/WTFString.h" 33 #include <v8.h> 34 35 struct NPObject; 36 37 namespace blink { class WebLayer; } 38 39 namespace blink { 40 41 class ResourceError; 42 class ResourceResponse; 43 class Scrollbar; 44 45 class PluginView : public Widget { 46 public: isPluginView()47 virtual bool isPluginView() const OVERRIDE FINAL { return true; } 48 platformLayer()49 virtual blink::WebLayer* platformLayer() const { return 0; } scriptableObject(v8::Isolate *)50 virtual v8::Local<v8::Object> scriptableObject(v8::Isolate*) { return v8::Local<v8::Object>(); } getFormValue(String &)51 virtual bool getFormValue(String&) { return false; } wantsWheelEvents()52 virtual bool wantsWheelEvents() { return false; } supportsKeyboardFocus()53 virtual bool supportsKeyboardFocus() const { return false; } supportsInputMethod()54 virtual bool supportsInputMethod() const { return false; } canProcessDrag()55 virtual bool canProcessDrag() const { return false; } 56 didReceiveResponse(const ResourceResponse &)57 virtual void didReceiveResponse(const ResourceResponse&) { } didReceiveData(const char *,int)58 virtual void didReceiveData(const char*, int) { } didFinishLoading()59 virtual void didFinishLoading() { } didFailLoading(const ResourceError &)60 virtual void didFailLoading(const ResourceError&) { } 61 62 protected: PluginView()63 PluginView() : Widget() { } 64 }; 65 66 DEFINE_TYPE_CASTS(PluginView, Widget, widget, widget->isPluginView(), widget.isPluginView()); 67 68 } // namespace blink 69 70 #endif // PluginView_h 71