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

Side by Side Diff: third_party/WebKit/Source/core/exported/WebPluginContainerBase.h

Issue 2901453002: Move PreFinalizer to WebPluginContainerImpl. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.#ifndef WebViewBase_h 3 // found in the LICENSE file.#ifndef WebViewBase_h
4 4
5 #ifndef WebPluginContainerBase_h 5 #ifndef WebPluginContainerBase_h
6 #define WebPluginContainerBase_h 6 #define WebPluginContainerBase_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/dom/ContextLifecycleObserver.h" 9 #include "core/dom/ContextLifecycleObserver.h"
10 #include "core/plugins/PluginView.h" 10 #include "core/plugins/PluginView.h"
(...skipping 14 matching lines...) Expand all
25 // WebPluginContainerImpl will then take a dependency on WebPluginContainerBase 25 // WebPluginContainerImpl will then take a dependency on WebPluginContainerBase
26 // instead, so we can remove cyclic dependencies in web/ and move classes from 26 // instead, so we can remove cyclic dependencies in web/ and move classes from
27 // web/ into core/ or modules. 27 // web/ into core/ or modules.
28 // TODO(slangley): Remove this class once WebPluginContainerImpl is in core/. 28 // TODO(slangley): Remove this class once WebPluginContainerImpl is in core/.
29 class CORE_EXPORT WebPluginContainerBase 29 class CORE_EXPORT WebPluginContainerBase
30 : public GarbageCollectedFinalized<WebPluginContainerBase>, 30 : public GarbageCollectedFinalized<WebPluginContainerBase>,
31 public PluginView, 31 public PluginView,
32 NON_EXPORTED_BASE(public WebPluginContainer), 32 NON_EXPORTED_BASE(public WebPluginContainer),
33 public ContextClient { 33 public ContextClient {
34 USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerBase); 34 USING_GARBAGE_COLLECTED_MIXIN(WebPluginContainerBase);
35 USING_PRE_FINALIZER(WebPluginContainerBase, DispatchDispose);
36 35
37 public: 36 public:
38 virtual int PrintBegin(const WebPrintParams&) const = 0; 37 virtual int PrintBegin(const WebPrintParams&) const = 0;
39 virtual void PrintPage(int page_number, GraphicsContext&, const IntRect&) = 0; 38 virtual void PrintPage(int page_number, GraphicsContext&, const IntRect&) = 0;
40 virtual void PrintEnd() = 0; 39 virtual void PrintEnd() = 0;
41 virtual bool ExecuteEditCommand(const WebString& name) = 0; 40 virtual bool ExecuteEditCommand(const WebString& name) = 0;
42 virtual bool ExecuteEditCommand(const WebString& name, 41 virtual bool ExecuteEditCommand(const WebString& name,
43 const WebString& value) = 0; 42 const WebString& value) = 0;
44 virtual bool SupportsPaginatedPrint() const = 0; 43 virtual bool SupportsPaginatedPrint() const = 0;
45 virtual bool IsPrintScalingDisabled() const = 0; 44 virtual bool IsPrintScalingDisabled() const = 0;
46 virtual bool GetPrintPresetOptionsFromDocument( 45 virtual bool GetPrintPresetOptionsFromDocument(
47 WebPrintPresetOptions*) const = 0; 46 WebPrintPresetOptions*) const = 0;
48 virtual void DidFinishLoading() = 0; 47 virtual void DidFinishLoading() = 0;
49 virtual void DidFailLoading(const ResourceError&) = 0; 48 virtual void DidFailLoading(const ResourceError&) = 0;
50 virtual void CalculateGeometry(IntRect& window_rect, 49 virtual void CalculateGeometry(IntRect& window_rect,
51 IntRect& clip_rect, 50 IntRect& clip_rect,
52 IntRect& unobscured_rect) = 0; 51 IntRect& unobscured_rect) = 0;
53 52
54 DECLARE_VIRTUAL_TRACE(); 53 DECLARE_VIRTUAL_TRACE();
55 // USING_PRE_FINALIZER does not allow for virtual dispatch from the finalizer
56 // method. Here we call Dispose() which does the correct virtual dispatch.
57 void DispatchDispose() { Dispose(); }
58 54
59 protected: 55 protected:
60 explicit WebPluginContainerBase(LocalFrame*); 56 explicit WebPluginContainerBase(LocalFrame*);
61 }; 57 };
62 58
63 DEFINE_TYPE_CASTS(WebPluginContainerBase, 59 DEFINE_TYPE_CASTS(WebPluginContainerBase,
64 PluginView, 60 PluginView,
65 plugin, 61 plugin,
66 plugin->IsPluginContainer(), 62 plugin->IsPluginContainer(),
67 plugin.IsPluginContainer()); 63 plugin.IsPluginContainer());
68 // Unlike FrameViewBase, we need not worry about object type for container. 64 // Unlike FrameViewBase, we need not worry about object type for container.
69 // WebPluginContainerBase is the only subclass of WebPluginContainer. 65 // WebPluginContainerBase is the only subclass of WebPluginContainer.
70 DEFINE_TYPE_CASTS(WebPluginContainerBase, 66 DEFINE_TYPE_CASTS(WebPluginContainerBase,
71 WebPluginContainer, 67 WebPluginContainer,
72 container, 68 container,
73 true, 69 true,
74 true); 70 true);
75 71
76 } // nammespace blink 72 } // nammespace blink
77 73
78 #endif // WebPluginContainerBase_h 74 #endif // WebPluginContainerBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698