| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. | 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerImpl); | 65 USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerImpl); |
| 66 USING_PRE_FINALIZER(WebPluginContainerImpl, Dispose); | 66 USING_PRE_FINALIZER(WebPluginContainerImpl, Dispose); |
| 67 | 67 |
| 68 public: | 68 public: |
| 69 static WebPluginContainerImpl* Create(HTMLPlugInElement* element, | 69 static WebPluginContainerImpl* Create(HTMLPlugInElement* element, |
| 70 WebPlugin* web_plugin) { | 70 WebPlugin* web_plugin) { |
| 71 return new WebPluginContainerImpl(element, web_plugin); | 71 return new WebPluginContainerImpl(element, web_plugin); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // PluginView methods | 74 // PluginView methods |
| 75 void SetParent(FrameView*) override; |
| 76 FrameView* Parent() const override; |
| 75 WebLayer* PlatformLayer() const override; | 77 WebLayer* PlatformLayer() const override; |
| 76 v8::Local<v8::Object> ScriptableObject(v8::Isolate*) override; | 78 v8::Local<v8::Object> ScriptableObject(v8::Isolate*) override; |
| 77 bool SupportsKeyboardFocus() const override; | 79 bool SupportsKeyboardFocus() const override; |
| 78 bool SupportsInputMethod() const override; | 80 bool SupportsInputMethod() const override; |
| 79 bool CanProcessDrag() const override; | 81 bool CanProcessDrag() const override; |
| 80 bool WantsWheelEvents() override; | 82 bool WantsWheelEvents() override; |
| 81 void UpdateAllLifecyclePhases() override; | 83 void UpdateAllLifecyclePhases() override; |
| 82 void InvalidatePaintIfNeeded() override { IssuePaintInvalidations(); } | 84 void InvalidatePaintIfNeeded() override { IssuePaintInvalidations(); } |
| 83 | 85 void InvalidateRect(const IntRect&); |
| 84 // FrameViewBase methods | |
| 85 void SetFrameRect(const IntRect&) override; | |
| 86 void Paint(GraphicsContext&, const CullRect&) const override; | |
| 87 void InvalidateRect(const IntRect&) override; | |
| 88 void SetFocused(bool, WebFocusType) override; | 86 void SetFocused(bool, WebFocusType) override; |
| 89 void Show() override; | |
| 90 void Hide() override; | |
| 91 void HandleEvent(Event*) override; | 87 void HandleEvent(Event*) override; |
| 92 void FrameRectsChanged() override; | 88 void FrameRectsChanged() override; |
| 93 void SetParentVisible(bool) override; | |
| 94 void GeometryMayHaveChanged() override; | 89 void GeometryMayHaveChanged() override; |
| 95 bool IsPluginContainer() const override { return true; } | 90 bool IsPluginContainer() const override { return true; } |
| 96 void EventListenersRemoved() override; | 91 void EventListenersRemoved() override; |
| 97 | 92 |
| 93 // FrameOrPlugin methods |
| 94 void SetFrameRect(const IntRect& frame_rect) override { |
| 95 frame_rect_ = frame_rect; |
| 96 } |
| 97 const IntRect& FrameRect() const override { return frame_rect_; } |
| 98 void Paint(GraphicsContext&, const CullRect&) const override; |
| 99 void Show() override; |
| 100 void Hide() override; |
| 101 |
| 98 // WebPluginContainer methods | 102 // WebPluginContainer methods |
| 99 WebElement GetElement() override; | 103 WebElement GetElement() override; |
| 100 WebDocument GetDocument() override; | 104 WebDocument GetDocument() override; |
| 101 void DispatchProgressEvent(const WebString& type, | 105 void DispatchProgressEvent(const WebString& type, |
| 102 bool length_computable, | 106 bool length_computable, |
| 103 unsigned long long loaded, | 107 unsigned long long loaded, |
| 104 unsigned long long total, | 108 unsigned long long total, |
| 105 const WebString& url) override; | 109 const WebString& url) override; |
| 106 void EnqueueMessageEvent(const WebDOMMessageEvent&) override; | 110 void EnqueueMessageEvent(const WebDOMMessageEvent&) override; |
| 107 void Invalidate() override; | 111 void Invalidate() override; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 203 |
| 200 void CalculateGeometry(IntRect& window_rect, | 204 void CalculateGeometry(IntRect& window_rect, |
| 201 IntRect& clip_rect, | 205 IntRect& clip_rect, |
| 202 IntRect& unobscured_rect, | 206 IntRect& unobscured_rect, |
| 203 Vector<IntRect>& cut_out_rects); | 207 Vector<IntRect>& cut_out_rects); |
| 204 void WindowCutOutRects(const IntRect& frame_rect, | 208 void WindowCutOutRects(const IntRect& frame_rect, |
| 205 Vector<IntRect>& cut_out_rects); | 209 Vector<IntRect>& cut_out_rects); |
| 206 | 210 |
| 207 friend class WebPluginContainerTest; | 211 friend class WebPluginContainerTest; |
| 208 | 212 |
| 213 Member<FrameView> parent_; |
| 209 Member<HTMLPlugInElement> element_; | 214 Member<HTMLPlugInElement> element_; |
| 210 WebPlugin* web_plugin_; | 215 WebPlugin* web_plugin_; |
| 211 | |
| 212 WebLayer* web_layer_; | 216 WebLayer* web_layer_; |
| 213 | 217 IntRect frame_rect_; |
| 214 IntRect pending_invalidation_rect_; | 218 IntRect pending_invalidation_rect_; |
| 215 | |
| 216 TouchEventRequestType touch_event_request_type_; | 219 TouchEventRequestType touch_event_request_type_; |
| 217 bool wants_wheel_events_; | 220 bool wants_wheel_events_; |
| 218 | 221 bool visible_; |
| 219 bool is_disposed_; | 222 bool is_disposed_; |
| 220 }; | 223 }; |
| 221 | 224 |
| 222 DEFINE_TYPE_CASTS(WebPluginContainerImpl, | 225 DEFINE_TYPE_CASTS(WebPluginContainerImpl, |
| 223 FrameViewBase, | 226 PluginView, |
| 224 frameViewBase, | 227 plugin, |
| 225 frameViewBase->IsPluginContainer(), | 228 plugin->IsPluginContainer(), |
| 226 frameViewBase.IsPluginContainer()); | 229 plugin.IsPluginContainer()); |
| 227 // Unlike FrameViewBase, we need not worry about object type for container. | 230 // Unlike FrameViewBase, we need not worry about object type for container. |
| 228 // WebPluginContainerImpl is the only subclass of WebPluginContainer. | 231 // WebPluginContainerImpl is the only subclass of WebPluginContainer. |
| 229 DEFINE_TYPE_CASTS(WebPluginContainerImpl, | 232 DEFINE_TYPE_CASTS(WebPluginContainerImpl, |
| 230 WebPluginContainer, | 233 WebPluginContainer, |
| 231 container, | 234 container, |
| 232 true, | 235 true, |
| 233 true); | 236 true); |
| 234 | 237 |
| 235 } // namespace blink | 238 } // namespace blink |
| 236 | 239 |
| 237 #endif | 240 #endif |
| OLD | NEW |